From 4535e421ed4580b4e89c0210d955a16e97eaf24a Mon Sep 17 00:00:00 2001 From: Kraig Amador Date: Tue, 13 Apr 2021 11:06:08 -0700 Subject: [PATCH] fix(cli): wrong account used when containers are pushed, a followup from #7022 --- packages/cdk-assets/lib/private/handlers/container-images.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cdk-assets/lib/private/handlers/container-images.ts b/packages/cdk-assets/lib/private/handlers/container-images.ts index a3b6756ecb18d..14ed880cb75d4 100644 --- a/packages/cdk-assets/lib/private/handlers/container-images.ts +++ b/packages/cdk-assets/lib/private/handlers/container-images.ts @@ -19,7 +19,7 @@ export class ContainerImageAssetHandler implements IAssetHandler { public async publish(): Promise { const destination = await replaceAwsPlaceholders(this.asset.destination, this.host.aws); const ecr = await this.host.aws.ecrClient(destination); - const account = (await this.host.aws.discoverCurrentAccount()).accountId; + const account = async () => (await this.host.aws.discoverCurrentAccount())?.accountId; const repoUri = await repositoryUri(ecr, destination.repositoryName); if (!repoUri) {