LambdaSharp::S3::Unzip
The LambdaSharp::S3::Unzip type creates a resource that unzips a Package item and copies its contents to an S3 bucket.
On creation, the contents of the source zip package are copied to the destination S3 bucket. On update, the resource checks which files in the zip package have been added, updated, or removed and only copies or deletes the affected files. On delete, the resource attempts to remove all files that were previously copied to the S3 bucket.
NOTE: The maximum size of the zip package is limited by the amount of temporary storage available to a Lambda function. At the time of this writing, this limit is 512MB.
Using
Using:
- Module: LambdaSharp.S3.IO:0.5@lambdasharp
Syntax
Type: LambdaSharp::S3::Unzip
Properties:
SourceBucket: String
SourceKey: String
DestinationBucket: String
DestinationKey: String
Properties
DestinationBucket-
The
DestinationBucketproperty specifies the destination S3 bucket name or ARN.Required: Yes
Type: String
DestinationKey-
The
DestinationKeyproperty specifies the destination prefix for all files copied from the zip package to destination S3 bucket.Required: Yes
Type: String
Encoding-
The
Encodingproperty sets the content encoding to apply to all files copied from the zip package. The value must be one of:NONE,BROTLI, orGZIP. The encoded files are annotated with aContent-Encodingheader matching the compression algorithm.Note that
BROTLIencoding is only valid for https:// connections.Required: No
Type: String
SourceBucket-
The
SourceBucketproperty specifies the source S3 bucket name or ARN for the zip package.Required: Yes
Type: String
SourceKey-
The
SourceKeyproperty specifies the source key for the zip package.Required: Yes
Type: String
Attributes
Url-
The
Urlattribute contains the S3 URL of the destination bucket and key:s3://destination-bucket-name/destination-key-prefix.Type: String
Examples
Create package of web assets and deploy them to an S3 bucket
- Resource: MyBucket
Type: AWS::S3::Bucket
- Package: MyPackage
Files: web-assets/
- Resource: DeployAssetsToBucket
Type: LambdaSharp::S3::Unzip
Properties:
SourceBucket: !Ref Deployment::BucketName
SourceKey: !Ref MyPackage
DestinationBucket: !Ref MyBucket
DestinationKey: assets/