4
3

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 1 year has passed since last update.

ひとつのAWSアカウントに複数のCDKをbootstrapする

Last updated at Posted at 2022-09-08

cdk.json がなぜか効かずハマったのでメモです。コマンドのパラメータに指定するとちゃんと効いてくれました。

terminal
cdk bootstrap --profile {プロファイル} \
         --cloudformation-execution-policies 'arn:aws:iam::aws:policy/AdministratorAccess' \
         --qualifier {CDKを区別するための文字列}

--qualifier デフォルトは hnb659fds (この文字列自体に意味はない)。 CDK を分けたいときにこのオプションを付与する。この値が、S3バケット名に使われるため、 指定可能な文字列は こちら を参考にしてください。

2023/04/05 編集
ちなみにダメだった cdk.json は以下の通り。
ターミナルで--qualifierを指定して実行後、cdk.jsonに下記を手動で追加する必要あります。cdk deploy したときに失敗するようです。

  • "@aws-cdk/core:bootstrapQualifier": "文字列"
cdk.json
{
  "app": "npx ts-node --prefer-ts-exts bin/hogehoge.ts",
  "context": {
    :
    "@aws-cdk/core:bootstrapQualifier": "文字列"
  },
  "toolkitStackName": "CDKToolKit〜"
}
4
3
0

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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?