Articles → AWS → UpdateReplacePolicy Attribute In AWS CloudFormation
UpdateReplacePolicy Attribute In AWS CloudFormation
Purpose
Value | Description |
---|
Retain | The existing resource is preserved instead of being deleted when replaced. |
Delete | The existing resource is deleted when replaced (default behaviour). |
Snapshot | A snapshot of the resource is taken before deletion. |
Create An S3 Bucket
AWSTemplateFormatVersion: "2010-09-09"
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: updatereplacepolicygyansangrah1
AWSTemplateFormatVersion: "2010-09-09"
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: updatereplacepolicygyansangrah2
Updatereplacepolicy Attribute Comes Into Picture
AWSTemplateFormatVersion: "2010-09-09"
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: updatereplacepolicygyansangrah1
UpdateReplacePolicy: Retain
AWSTemplateFormatVersion: "2010-09-09"
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: updatereplacepolicygyansangrah2
UpdateReplacePolicy: Retain
Output
Posted By - | Karan Gupta |
|
Posted On - | Sunday, March 16, 2025 |