How to resolve: 'Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment'

Drew Gallagher picture Drew Gallagher · Nov 20, 2019 · Viewed 9.7k times · Source

I am trying to run CDK commands to check the diff of my local and remote stack.

I am using the following command.

cdk diff --profile saml

I am getting the following error message

Unable to resolve AWS account to use. It must be either configured when you define your CDK or through the environment

I am looking for ways to resolve this issue.

Answer

milan picture milan · Dec 3, 2019

Removing [profile default] from ~/.aws/config solved it for me.