Error: Need to perform AWS calls for account 000, but no credentials have been configured

See original GitHub issue

Error running cdklocal bootstrap & deploy

Environment aws://000/us-west-2 failed bootstrapping: Error: Need to perform AWS calls for account 000, but no credentials have been configured

I am running localstack start in one powershell and cdklocal bootstrap/deploy in another. I also tried once with localstack started in a docker container and mapped to my computer’s “localhost:4566”

Everything works fine when I actually deploy to AWS/CDK but does not work when I try localstack/CDK.

Troubleshooting

I feel like I’ve tried just about everything to get this to work, but no luck yet (including solutions from the other issues like https://github.com/localstack/aws-cdk-local/issues/36#issuecomment-743919267 & https://github.com/localstack/aws-cdk-local/issues/38). Here’s what I’ve tried:

  • Deleting node_modules and cdk.out, then combinations of installing aws-cdk-local 1.65.3 & aws-cdk 1.86.0/1.89.0, globally/locally

  • Executing locally installed packages via “npx” command (e.g. npx cdklocal bootstrap)

  • Using cdklocal --profile flag with my actual account name and also with “default”

Setup

I can start my localstack just fine on Windows 10 and also in docker: http://localhost:4566/health

"services": {
"cloudwatch": "running",
"iam": "running",
"lambda": "running",
"logs": "running",
"apigateway": "running"
}

C:/Users/me/.aws/config

[default]
sso_start_url = https://________.com/start
sso_region = us-west-2
sso_account_id = 9999999
sso_role_name = 9999999_MyRoleName
region = us-west-2
ca_bundle = C:\Program Files\Amazon\AWSCLIV2\mycert.pem
output = json[default]

C:/Users/me/.aws/credentials

[default]
aws_access_key_id=test
aws_secret_access_key=test
region=us-west-2

[(my account id)]
aws_access_key_id=(my key id)
aws_secret_access_key=(my access key)
aws_session_token=(my token)
region=us-west-2

package.json

"devDependencies": {
  ...
  "aws-cdk": "1.86.0",
  "aws-cdk-local": "^1.65.3",
  "typescript": "~3.9.7"
},
"dependencies": {
  "@aws-cdk/aws-ec2": "1.86.0",
  "@aws-cdk/aws-apigateway": "1.86.0",
  "@aws-cdk/aws-lambda": "1.86.0",
  "@aws-cdk/aws-logs": "1.86.0",
  "@aws-cdk/core": "1.86.0",
  ...
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ajaysuwalkacommented, Dec 14, 2021

@whummer Sorry but that’s really outdated stuff now, but the method that I had specified, works fine.

1reaction
moltarcommented, Dec 14, 2021

Same issue here. Even bootstrapping does not work.

❯ cdklocal bootstrap            
'@aws-cdk/core:newStyleStackSynthesis' context set, using new-style bootstrapping
 ⏳  Bootstrapping environment aws://708XXXXXXXXX/ap-northeast-1...
 ❌  Environment aws://708XXXXXXXXX/ap-northeast-1 failed bootstrapping: Error: Need to perform AWS calls for account 708XXXXXXXXX, but the current credentials are for 000000000000

My stacks are configured to deploy to specific environments with hard-coded account IDs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Need to perform AWS calls for account xxx, but no credentials ...
I have run aws configure and inserted the correct keys for the IAM user im using. So again, it only works when im...
Read more >
CDK errors with no credentials have been configured if ...
Error : Need to perform AWS calls for account 000, but no credentials have been configured localstack/aws-cdk-local#39.
Read more >
awslabs/aws-cdk - Gitter
Need to perform AWS calls for account XXXX-XXXX-XXXX, but no credentials found. Tried: default credentials. I've tried ENV, ~/.aws/config with profile and ......
Read more >
error exec CDK from BuildSpec - AWS re:Post
mystackName failed: Error: Need to perform AWS calls for account xxxxxxxx(DEV_ACCOUNT_ID), but the current credentials are for yyyyyy (STG_ACCOUNT_ID).
Read more >
Configure AWS Credentials | Webiny Docs
This article guides you through configuring your AWS credentials for programmatic access. At the end of the tutorial, you will have your API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found