Last updated: Jan 26, 2024
Reading time·1 min
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.
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
.
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.
{ "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.
You can learn more about the related topics by checking out the following tutorials: