1

I am following the tutorial linked here using Python on Windows: https://docs.aws.amazon.com/cdk/latest/guide/hello_world.html

Everything seems fine until I try to use cdk deploy, and end up getting the following error:

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

I have tried configuring the credentials through both AWS CLI and environment variables. Using the -v flag, it does not seem to find my credentials at all, even though AWS CLI seems to detect that the credentials work.

These are what my credential files look like:

credentials:

[default]
aws_access_key_id = *****************
aws_secret_access_key = **************
aws_session_token= ****************

config:

[default]
region = us-east-1 
James
  • 4,211
  • 1
  • 18
  • 34
Karma Cool
  • 61
  • 8
  • 2
    Please see https://docs.aws.amazon.com/cdk/latest/guide/cli.html#cli-environment, possibly delete the env variables and make sure that the config files are in right directory – Milan Gatyás Oct 13 '21 at 09:26
  • Is this still an issue? If so, can you please confirm that the aws-cli works properly with your credentials? For example, what do get if you type: `aws sts get-caller-identity`? – James Oct 15 '21 at 12:07
  • Also, I see that you have a session token... Most likely, you are executing under an assumed role... What's the use case here? Session-based credentials are temporary and therefore, hardcoding them in your AWS credentials file is generally not the way to go... – James Oct 15 '21 at 12:07

0 Answers0