CDK: Need to perform calls for Account A but credentials are for Account B

Edgar Sanchez
Nov 15, 2021

I recently got this error and I couldn’t figure it out: My CDK deploy kept failing because:

fail: Need to perform AWS calls for account 111111111111, but the current credentials are for 22222222222

My deployment job had been working perfectly for months until this error above showed up.

REASON: While troubleshooting a CloudFormation stack issue, I had deleted all the resources used in the CloudFormation Stack which included a reference to an assets zip file stored in a bucket called:

bucket s3://cdk-hnb659fds-assets-222222222222-eu-west-1/

I thought — I just deleted this one too.

#TLDR: Confirm that you didn’t delete the AWS bucket used by CDK itself.

--

--

Edgar Sanchez

A great architect - humble in spirit. dangerous with production access.