aws-cdk-local: latest cdklocal/localstack fails to bootstrap

I upgraded cdklocal and localstack

I’m running localstack on Windows 10 . Below are the versions of the tools

$ cdklocal --version
1.77.0 (build a941c53)
$ docker images | grep localstack
localstack/localstack                  latest                  25b151909437        58 minutes ago      638MB
$ localstack --version
0.12.2

I have started localstack by running

$ localstack start

Then when I run

$ cdklocal bootstrap

I get the following errors

 ⏳  Bootstrapping environment aws://000000000000/eu-central-1...
CDKToolkit: creating CloudFormation changeset...
 0/3 | 14:00:48 | REVIEW_IN_PROGRESS   | AWS::CloudFormation::Stack | CDKToolkit User Initiated
 0/3 | 14:00:48 | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack | CDKToolkit 
 0/3 | 14:00:48 | UPDATE_IN_PROGRESS   | AWS::CloudFormation::Stack | CDKToolkit
 0/3 | 14:00:48 | UPDATE_COMPLETE      | AWS::CloudFormation::Stack | CDKToolkit
 0/3 | 14:00:48 | CREATE_COMPLETE      | AWS::CloudFormation::Stack | CDKToolkit 
 0/3 | 14:00:48 | CREATE_COMPLETE      | AWS::CloudFormation::Stack | CDKToolkit
 0/3 | 14:00:48 | CREATE_FAILED        | AWS::CloudFormation::Stack | CDKToolkit
 ❌  Environment aws://000000000000/eu-central-1 failed bootstrapping: Error: The stack named CDKToolkit failed to deploy: CREATE_FAILED
    at Object.waitForStackDeploy (C:\Users\lwong1\.npm-packages\node_modules\aws-cdk\lib\api\util\cloudformation.ts:307:11)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at Object.deployStack (C:\Users\lwong1\.npm-packages\node_modules\aws-cdk\lib\api\deploy-stack.ts:283:26)
    at C:\Users\lwong1\.npm-packages\node_modules\aws-cdk\lib\cdk-toolkit.ts:358:24
    at async Promise.all (index 0)
    at CdkToolkit.bootstrap (C:\Users\lwong1\.npm-packages\node_modules\aws-cdk\lib\cdk-toolkit.ts:355:5)
    at initCommandLine (C:\Users\lwong1\.npm-packages\node_modules\aws-cdk\bin\cdk.ts:201:9)
The stack named CDKToolkit failed to deploy: CREATE_FAILED

Prior to upgrading localstack it was still working. But perhaps this issue has the same cause as https://github.com/localstack/aws-cdk-local/issues/5 ?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 27 (6 by maintainers)

Most upvoted comments

Thanks for the update @Tehnix @denisdifazio @sbassin . We just did a quick test with the versions specified above (aws-cdk-local@1.65.2, aws-cdk@1.81.0), and it seems to be working with latest. Can you please do a docker pull localstack/localstack and give it another try with the latest Docker image?

What are the error logs you’re seeing - is it the same message as @denisdifazio posted above: Unable to determine the default AWS account: 404: …? Can you please share a minimal example (e.g., as a small project in a Github repo) to help reproduce this issue? Thanks for your help

@whummer awesome, I just tested and with latest and aws-cdk version 1.81.0 (build 6ef67c7) the whole flow worked 😃

Just wanted to also say thanks for all the effort y’all are doing! Especially responding on weekends like this 😅

I’m having a very similar issue, though with different output. Also on the latest localstack, but I’m on 1.78.0 of cdklocal.

When I cdklocal bootstrap, I get:

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

When I cdklocal bootstrap aws://000000000000/us-east-1 like @guoliang, I get:

 ⏳  Bootstrapping environment aws://000000000000/us-east-1...
 ❌  Environment aws://000000000000/us-east-1 failed bootstrapping: Error: Need to perform AWS calls for account 000000000000, but no credentials have been configured
    at SdkProvider.forEnvironment (/Users/sbassin/.nvm/versions/node/v12.20.0/lib/node_modules/aws-cdk-local/node_modules/aws-cdk/lib/api/aws-auth/sdk-provider.ts:149:46)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at Function.lookup (/Users/sbassin/.nvm/versions/node/v12.20.0/lib/node_modules/aws-cdk-local/node_modules/aws-cdk/lib/api/bootstrap/deploy-bootstrap.ts:35:17)
    at Bootstrapper.legacyBootstrap (/Users/sbassin/.nvm/versions/node/v12.20.0/lib/node_modules/aws-cdk-local/node_modules/aws-cdk/lib/api/bootstrap/bootstrap-environment.ts:61:21)
    at /Users/sbassin/.nvm/versions/node/v12.20.0/lib/node_modules/aws-cdk-local/node_modules/aws-cdk/lib/cdk-toolkit.ts:358:24
    at async Promise.all (index 0)
    at CdkToolkit.bootstrap (/Users/sbassin/.nvm/versions/node/v12.20.0/lib/node_modules/aws-cdk-local/node_modules/aws-cdk/lib/cdk-toolkit.ts:355:5)
    at initCommandLine (/Users/sbassin/.nvm/versions/node/v12.20.0/lib/node_modules/aws-cdk-local/node_modules/aws-cdk/bin/cdk.ts:201:9)
Need to perform AWS calls for account 000000000000, but no credentials have been configured

This was working recently with 1.76.0. The only change that stood out to me as a possible breaking one between the two versions of CDK was https://github.com/aws/aws-cdk/pull/11966, but I can’t find anything in that PR itself that looks like it would cause this problem. Though that aws-cdk/lib/api/aws-auth/sdk-provider.ts:149:46 is part of the change set.

Edit More Context: FWIW, my local I have in my config file:

[profile localstack]
region=us-east-1
output=json

and in my credentials file:

[localstack]
aws_access_key_id=test
aws_secret_access_key=test

This is also failing in my CI environment where I use environment variables:

AWS_DEFAULT_REGION=us-east-1
AWS_SECRET_ACCESS_KEY=test
AWS_ACCESS_KEY_ID=test

Using localstack latest (0.12.6) when CDK attempts to lookup default account ID from STS, localstack outputs:

localstack_1  | localstack.utils.server.http2_server.HTTPErrorResponse: Unable to find listener for service "sts" - please make sure to include it in $SERVICES

Followed the advice, all working now 😊

@whummer Yep, it’s working with the latest release. Thanks very much! 👍

@sbassin Perhaps you may need to clean the existing state in your ~/.cdk/... or local cdk.out folder…?