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
Bucket
property specifies the S3 bucket name or ARN to empty.Required: Yes
Type: String
Enabled
-
The
Enabled
property controls if the bucket will be emptied when the resource is deleted. Setting theEnabled
property tofalse
allows the resource to be removed on a subsequent update without affecting the attached bucket.Required: No
Type: Boolean
Attributes
BucketName
-
The
BucketName
attribute 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