LoginSignup
1
0

More than 5 years have passed since last update.

CloudFormationで作成したS3バケットのリソースをテンプレートファイルから削除してUpdate Stackしたときの動きについて

Posted at

結論

S3バケットが空の場合は、テンプレートファイルからリソースを削除するとS3バケット自体も削除される。
S3バケット上にデータが格納されている場合、テンプレートファイルからリソースを削除してもS3バケットは削除されない。

試してみた

初期状態

AWSTemplateFormatVersion: 2010-09-09
Resources:
  S3Bucketa:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: atsum-cfn-test-a
Resources:
  S3Bucketb:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: atsum-cfn-test-b

バケットAにファイルをアップロードする
テンプレートを修正

AWSTemplateFormatVersion: 2010-09-09
Resources:
Resources:
  S3Bucketb:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: atsum-cfn-test-b

UpdateStackする

Deleteは失敗する
image.png

S3バケットは存在する
image.png

Stackのリソースとしては、削除されている
image.png

お約束

投稿内容は私個人の意見であり、所属企業・部門見解を代表するものではありません。

1
0
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
1
0