Skip to content

Error in sandbox of not being booted, but is booted.

0

I get this error current credentials could not be used to assume 'arn:aws:iam::956394424627:role/cdk-hnb659fds-deploy-role-956394424627-us-east-2', but are for the right account. Proceeding anyway.

This AWS account and region has not been bootstrapped. Caused By: Is account 956394424627 bootstrapped

When I run: cdk bootstrap aws://956394424627/us-east-2

It states it is bootstrapped. Using default execution policy of 'arn:aws:iam::aws:policy/AdministratorAccess'. Pass '--cloudformation-execution-policies' to customize. ✅ Environment aws://956394424627/us-east-2 bootstrapped (no changes).

asked a year ago110 views

1 Answer
0

This is a common issue where the CDK bootstrap process appears successful, but the deployment still fails with a bootstrap detection error. There are several potential causes and solutions:

  1. Region Mismatch: Ensure the region in your deployment command matches the bootstrapped region. Set the AWS_DEFAULT_REGION environment variable to us-east-2 to make sure your commands are targeting the correct region.

  2. New Bootstrap Format: Try setting the environment variable CDK_NEW_BOOTSTRAP=1 and then run the bootstrap command again. Amplify and newer CDK versions use a different bootstrap format than older versions.

  3. Try Alternative Bootstrap Command: Use the AWS CDK CLI directly with:

npx aws-cdk@latest bootstrap aws://956394424627/us-east-2
  1. Verify Bootstrap Stack: Check if the CloudFormation stack named "CDKToolkit" exists in your us-east-2 region. This confirms whether bootstrapping was successful.

  2. Permissions Issue: Verify that your IAM user or role has the necessary permissions to access the bootstrap resources. The error message indicates credential issues with assuming the deploy role.

  3. Clear Local Cache: If you're using Amplify, try clearing your local Amplify cache by removing the .amplify directory in your project folder.

If the issue persists after trying these steps, you might need to check CloudTrail logs for any denied API calls related to accessing the bootstrap resources or assuming the deploy role.
Sources
ran cdk bootstrap aws://956394424627/us-east-2 successfully but deploy says BootstrapNotDetectedError: This AWS account and region has not been bootstrapped. | AWS re:Post
CDK Bootstraping | AWS re:Post
Deployment - Verifiable Controls Evidence Store
My Amplify environment started to fail in a sudden. Bootstrap Error | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.