21
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【AWS CDK】cdk deploy, cdk destroyの `(y/n)?`を上書きする

Last updated at Posted at 2021-06-22

はじめに

通常、cdk deploycdk destroyすると以下のように(y/n)?と表示される。

deploy.sh
$ cdk deploy
~~
Do you wish to deploy these changes (y/n)?
destroy.sh
$ cdk destroy
~~
Are you sure you want to delete: YourStackName (y/n)?

ただ、これらのコマンドを自動化する際はこの表示が煩わしいため、オプションなりで上書きする方法を調べてみた。

cdk deploy

--require-approval オプションに never を指定する。

cdk deploy --require-approval never

もしくは、cdk.json"requireApproval": "never" を追加する。

cdk destroy

-f or --force オプションを用いる。

cdk destroy --force

参考

21
5
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?