Class BucketDeployment.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<BucketDeployment>
- Enclosing class:
BucketDeployment
BucketDeployment
.-
Method Summary
Modifier and TypeMethodDescriptionaccessControl
(BucketAccessControl accessControl) System-defined x-amz-acl metadata to be set on all objects in the deployment.build()
cacheControl
(List<? extends CacheControl> cacheControl) System-defined cache-control metadata to be set on all objects in the deployment.contentDisposition
(String contentDisposition) System-defined cache-disposition metadata to be set on all objects in the deployment.contentEncoding
(String contentEncoding) System-defined content-encoding metadata to be set on all objects in the deployment.contentLanguage
(String contentLanguage) System-defined content-language metadata to be set on all objects in the deployment.contentType
(String contentType) System-defined content-type metadata to be set on all objects in the deployment.static BucketDeployment.Builder
destinationBucket
(IBucket destinationBucket) The S3 bucket to sync the contents of the zip file to.destinationKeyPrefix
(String destinationKeyPrefix) Key prefix in the destination bucket.distribution
(IDistribution distribution) The CloudFront distribution using the destination bucket as an origin.distributionPaths
(List<String> distributionPaths) The file paths to invalidate in the CloudFront distribution.ephemeralStorageSize
(Size ephemeralStorageSize) The size of the AWS Lambda function’s /tmp directory in MiB.If this is set, matching files or objects will be excluded from the deployment's sync command.expires
(Expiration expires) System-defined expires metadata to be set on all objects in the deployment.If this is set, the zip file will be synced to the destination S3 bucket and extracted.If this is set, matching files or objects will be included with the deployment's sync command.The Log Group used for logging of events emitted by the custom resource's lambda function.logRetention
(RetentionDays logRetention) The number of days that the lambda function's log events are kept in CloudWatch Logs.memoryLimit
(Number memoryLimit) The amount of memory (in MiB) to allocate to the AWS Lambda function which replicates the files from the CDK bucket to the destination bucket.User-defined object metadata to be set on all objects in the deployment.outputObjectKeys
(Boolean outputObjectKeys) If set to false, the custom resource will not send back the SourceObjectKeys.By default, files in the destination bucket that don't exist in the source will be deleted when the BucketDeployment resource is created or updated.retainOnDelete
(Boolean retainOnDelete) If this is set to "false", the destination files will be deleted when the resource is deleted or the destination is updated.Execution role associated with this function.serverSideEncryption
(ServerSideEncryption serverSideEncryption) System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment.serverSideEncryptionAwsKmsKeyId
(String serverSideEncryptionAwsKmsKeyId) System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment.serverSideEncryptionCustomerAlgorithm
(String serverSideEncryptionCustomerAlgorithm) System-defined x-amz-server-side-encryption-customer-algorithm metadata to be set on all objects in the deployment.signContent
(Boolean signContent) If set to true, uploads will precompute the value ofx-amz-content-sha256
and include it in the signed S3 request headers.The sources from which to deploy the contents of this bucket.storageClass
(StorageClass storageClass) System-defined x-amz-storage-class metadata to be set on all objects in the deployment.Mount an EFS file system.The VPC network to place the deployment lambda handler in.vpcSubnets
(SubnetSelection vpcSubnets) Where in the VPC to place the deployment lambda handler.websiteRedirectLocation
(String websiteRedirectLocation) System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment.
-
Method Details
-
create
@Stability(Stable) public static BucketDeployment.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
BucketDeployment.Builder
.
-
destinationBucket
The S3 bucket to sync the contents of the zip file to.- Parameters:
destinationBucket
- The S3 bucket to sync the contents of the zip file to. This parameter is required.- Returns:
this
-
sources
The sources from which to deploy the contents of this bucket.- Parameters:
sources
- The sources from which to deploy the contents of this bucket. This parameter is required.- Returns:
this
-
accessControl
System-defined x-amz-acl metadata to be set on all objects in the deployment.Default: - Not set.
- Parameters:
accessControl
- System-defined x-amz-acl metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
cacheControl
@Stability(Stable) public BucketDeployment.Builder cacheControl(List<? extends CacheControl> cacheControl) System-defined cache-control metadata to be set on all objects in the deployment.Default: - Not set.
- Parameters:
cacheControl
- System-defined cache-control metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
contentDisposition
System-defined cache-disposition metadata to be set on all objects in the deployment.Default: - Not set.
- Parameters:
contentDisposition
- System-defined cache-disposition metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
contentEncoding
System-defined content-encoding metadata to be set on all objects in the deployment.Default: - Not set.
- Parameters:
contentEncoding
- System-defined content-encoding metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
contentLanguage
System-defined content-language metadata to be set on all objects in the deployment.Default: - Not set.
- Parameters:
contentLanguage
- System-defined content-language metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
contentType
System-defined content-type metadata to be set on all objects in the deployment.Default: - Not set.
- Parameters:
contentType
- System-defined content-type metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
destinationKeyPrefix
@Stability(Stable) public BucketDeployment.Builder destinationKeyPrefix(String destinationKeyPrefix) Key prefix in the destination bucket. Must be <=104 characters.If it's set with prune: true, it will only prune files with the prefix.
We recommend to always configure the
destinationKeyPrefix
property. This will prevent the deployment from accidentally deleting data that wasn't uploaded by it.Default: "/" (unzip to root of the destination bucket)
- Parameters:
destinationKeyPrefix
- Key prefix in the destination bucket. Must be <=104 characters. This parameter is required.- Returns:
this
-
distribution
The CloudFront distribution using the destination bucket as an origin.Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
Default: - No invalidation occurs
- Parameters:
distribution
- The CloudFront distribution using the destination bucket as an origin. This parameter is required.- Returns:
this
-
distributionPaths
@Stability(Stable) public BucketDeployment.Builder distributionPaths(List<String> distributionPaths) The file paths to invalidate in the CloudFront distribution.Default: - All files under the destination bucket key prefix will be invalidated.
- Parameters:
distributionPaths
- The file paths to invalidate in the CloudFront distribution. This parameter is required.- Returns:
this
-
ephemeralStorageSize
The size of the AWS Lambda function’s /tmp directory in MiB.Default: 512 MiB
- Parameters:
ephemeralStorageSize
- The size of the AWS Lambda function’s /tmp directory in MiB. This parameter is required.- Returns:
this
-
exclude
If this is set, matching files or objects will be excluded from the deployment's sync command.This can be used to exclude a file from being pruned in the destination bucket.
If you want to just exclude files from the deployment package (which excludes these files evaluated when invalidating the asset), you should leverage the
exclude
property ofAssetOptions
when defining your source.Default: - No exclude filters are used
- Parameters:
exclude
- If this is set, matching files or objects will be excluded from the deployment's sync command. This parameter is required.- Returns:
this
- See Also:
-
expires
System-defined expires metadata to be set on all objects in the deployment.Default: - The objects in the distribution will not expire.
- Parameters:
expires
- System-defined expires metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
extract
If this is set, the zip file will be synced to the destination S3 bucket and extracted.If false, the file will remain zipped in the destination bucket.
Default: true
- Parameters:
extract
- If this is set, the zip file will be synced to the destination S3 bucket and extracted. This parameter is required.- Returns:
this
-
include
If this is set, matching files or objects will be included with the deployment's sync command.Since all files from the deployment package are included by default, this property is usually leveraged alongside an
exclude
filter.Default: - No include filters are used and all files are included with the sync command
- Parameters:
include
- If this is set, matching files or objects will be included with the deployment's sync command. This parameter is required.- Returns:
this
- See Also:
-
logGroup
The Log Group used for logging of events emitted by the custom resource's lambda function.Providing a user-controlled log group was rolled out to commercial regions on 2023-11-16. If you are deploying to another type of region, please check regional availability first.
Default: - a default log group created by AWS Lambda
- Parameters:
logGroup
- The Log Group used for logging of events emitted by the custom resource's lambda function. This parameter is required.- Returns:
this
-
logRetention
The number of days that the lambda function's log events are kept in CloudWatch Logs.This is a legacy API and we strongly recommend you migrate to
logGroup
if you can.logGroup
allows you to create a fully customizable log group and instruct the Lambda function to send logs to it.Default: logs.RetentionDays.INFINITE
- Parameters:
logRetention
- The number of days that the lambda function's log events are kept in CloudWatch Logs. This parameter is required.- Returns:
this
-
memoryLimit
The amount of memory (in MiB) to allocate to the AWS Lambda function which replicates the files from the CDK bucket to the destination bucket.If you are deploying large files, you will need to increase this number accordingly.
Default: 128
- Parameters:
memoryLimit
- The amount of memory (in MiB) to allocate to the AWS Lambda function which replicates the files from the CDK bucket to the destination bucket. This parameter is required.- Returns:
this
-
metadata
User-defined object metadata to be set on all objects in the deployment.Default: - No user metadata is set
- Parameters:
metadata
- User-defined object metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
outputObjectKeys
If set to false, the custom resource will not send back the SourceObjectKeys.This is useful when you are facing the error
Response object is too long
See https://github.com/aws/aws-cdk/issues/28579
Default: true
- Parameters:
outputObjectKeys
- If set to false, the custom resource will not send back the SourceObjectKeys. This parameter is required.- Returns:
this
-
prune
By default, files in the destination bucket that don't exist in the source will be deleted when the BucketDeployment resource is created or updated.If this is set to false, files in the destination bucket that do not exist in the asset, will NOT be deleted during deployment (create/update).
Default: true
- Parameters:
prune
- By default, files in the destination bucket that don't exist in the source will be deleted when the BucketDeployment resource is created or updated. This parameter is required.- Returns:
this
- See Also:
-
retainOnDelete
If this is set to "false", the destination files will be deleted when the resource is deleted or the destination is updated.NOTICE: Configuring this to "false" might have operational implications. Please visit to the package documentation referred below to make sure you fully understand those implications.
Default: true - when resource is deleted/updated, files are retained
- Parameters:
retainOnDelete
- If this is set to "false", the destination files will be deleted when the resource is deleted or the destination is updated. This parameter is required.- Returns:
this
- See Also:
-
role
Execution role associated with this function.Default: - A role is automatically created
- Parameters:
role
- Execution role associated with this function. This parameter is required.- Returns:
this
-
serverSideEncryption
@Stability(Stable) public BucketDeployment.Builder serverSideEncryption(ServerSideEncryption serverSideEncryption) System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment.Default: - Server side encryption is not used.
- Parameters:
serverSideEncryption
- System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
serverSideEncryptionAwsKmsKeyId
@Stability(Stable) public BucketDeployment.Builder serverSideEncryptionAwsKmsKeyId(String serverSideEncryptionAwsKmsKeyId) System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment.Default: - Not set.
- Parameters:
serverSideEncryptionAwsKmsKeyId
- System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
serverSideEncryptionCustomerAlgorithm
@Stability(Stable) public BucketDeployment.Builder serverSideEncryptionCustomerAlgorithm(String serverSideEncryptionCustomerAlgorithm) System-defined x-amz-server-side-encryption-customer-algorithm metadata to be set on all objects in the deployment.Warning: This is not a useful parameter until this bug is fixed: https://github.com/aws/aws-cdk/issues/6080
Default: - Not set.
- Parameters:
serverSideEncryptionCustomerAlgorithm
- System-defined x-amz-server-side-encryption-customer-algorithm metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
signContent
If set to true, uploads will precompute the value ofx-amz-content-sha256
and include it in the signed S3 request headers.Default: - `x-amz-content-sha256` will not be computed
- Parameters:
signContent
- If set to true, uploads will precompute the value ofx-amz-content-sha256
and include it in the signed S3 request headers. This parameter is required.- Returns:
this
-
storageClass
System-defined x-amz-storage-class metadata to be set on all objects in the deployment.Default: - Default storage-class for the bucket is used.
- Parameters:
storageClass
- System-defined x-amz-storage-class metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
useEfs
Mount an EFS file system.Enable this if your assets are large and you encounter disk space errors. Enabling this option will require a VPC to be specified.
Default: - No EFS. Lambda has access only to 512MB of disk space.
- Parameters:
useEfs
- Mount an EFS file system. This parameter is required.- Returns:
this
-
vpc
The VPC network to place the deployment lambda handler in.This is required if
useEfs
is set.Default: None
- Parameters:
vpc
- The VPC network to place the deployment lambda handler in. This parameter is required.- Returns:
this
-
vpcSubnets
Where in the VPC to place the deployment lambda handler.Only used if 'vpc' is supplied.
Default: - the Vpc default strategy if not specified
- Parameters:
vpcSubnets
- Where in the VPC to place the deployment lambda handler. This parameter is required.- Returns:
this
-
websiteRedirectLocation
@Stability(Stable) public BucketDeployment.Builder websiteRedirectLocation(String websiteRedirectLocation) System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment.Default: - No website redirection.
- Parameters:
websiteRedirectLocation
- System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment. This parameter is required.- Returns:
this
- See Also:
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<BucketDeployment>
- Returns:
- a newly built instance of
BucketDeployment
.
-