LambdaSharp::S3::EmptyBucket
The LambdaSharp::S3::EmptyBucket type creates a resource that empties the attached S3 bucket when the resource is deleted.
On creation or update, nothing happens. On the deletion, the contents of the S3 bucket will be deleted.
Using
Using:
- Module: LambdaSharp.S3.IO:0.5@lambdasharp
Syntax
Type: LambdaSharp::S3::EmptyBucket
Properties:
Bucket: String
Enabled: Boolean
Properties
Bucket-
The
Bucketproperty specifies the S3 bucket name or ARN to empty.Required: Yes
Type: String
Enabled-
The
Enabledproperty controls if the bucket will be emptied when the resource is deleted. Setting theEnabledproperty tofalseallows the resource to be removed on a subsequent update without affecting the attached bucket.Required: No
Type: Boolean
Attributes
BucketName-
The
BucketNameattribute contains the name of the attached S3 bucket.Type: String
Examples
Empty bucket when module is torn down
- Resource: MyBucket
Type: AWS::S3::Bucket
- Resource: EmptyMyBucket
Type: LambdaSharp::S3::EmptyBucket
Properties:
Bucket: !Ref MyBucket