- Newest
- Most votes
- Most comments
This issue appears to be related to AWS CDK bootstrapping, which is required for Amplify Gen 2 backend deployments.
Based on the error you're seeing, here are some steps to resolve the issue:
- Bootstrap your AWS account and region: The error suggests that CDK can't publish assets because your AWS account and region haven't been properly bootstrapped. Run the following command in your terminal:
cdk bootstrap aws://{YOUR_ACCOUNT_ID}/{YOUR_REGION}
Replace the placeholders with your actual AWS account ID and region.
-
Verify bootstrap status: After running the bootstrap command, check your CloudFormation console in the correct region to confirm a stack named
CDKToolkitexists, which indicates successful bootstrapping. -
Ensure proper deployment sequence: For Amplify Gen 2, you need to run
npx ampx pipeline-deployduring the build phase. Check your amplify.yml file to ensure it includes this command with the correct parameters:
pnpm exec ampx pipeline-deploy --branch $AWS_BRANCH --app-id $AWS_APP_ID
-
Generate outputs file: The amplify_outputs.json file should be generated during build time using the command mentioned above. This file should be git-ignored as it's environment-specific and will be generated during deployment.
-
Check region consistency: Ensure the region you bootstrapped matches the region your application is trying to deploy to. You might need to set environment variables like
AWS_DEFAULT_REGIONto ensure consistency.
If the issue persists, you might need to check your IAM permissions to ensure the deployment role has sufficient permissions to access bootstrap resources.
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
Is amplify_outputs.json safe in client code + should we gitignore it | AWS re:Post
Encountering an issue while setting up my Amplify Data backend | AWS re:Post
Aws amplify generation 2 backend code not deploy | AWS re:Post
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 4 years ago
