How to CDK Deploy Without the Prompt for Approval

avatar
Borislav Hadzhiev

Last updated: Jan 26, 2024
1 min

banner

# Deploying your CDK Stack without being asked for Approval

By default, when we run the cdk deploy command, the CDK CLI checks whether we have made changes to any IAM statements or security group rules, if that's the case it asks us to confirm the deployment.

ask approval

To cdk deploy without being prompted for approval, we have to add the --require-approval flag to the command and set the approval level to never.

shell
npx aws-cdk deploy --require-approval never

Alternatively, we can set the configuration in the cdk.json file in the root directory of our project.

cdk.json
{ "app": "npx ts-node --prefer-ts-exts bin/app.ts", "requireApproval": "never", "context": { // ... rest } }

By setting the --require-approval flag to never, the CDK CLI will not ask us for approval regardless of the changes we make to IAM resources.

require approval never

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.