Class BucketDeploymentProps.Builder
java.lang.Object
software.amazon.awscdk.services.s3.deployment.BucketDeploymentProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<BucketDeploymentProps>
- Enclosing interface:
BucketDeploymentProps
@Stability(Stable)
public static final class BucketDeploymentProps.Builder
extends Object
implements software.amazon.jsii.Builder<BucketDeploymentProps>
A builder for
BucketDeploymentProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccessControl
(BucketAccessControl accessControl) Sets the value ofBucketDeploymentProps.getAccessControl()
build()
Builds the configured instance.cacheControl
(List<? extends CacheControl> cacheControl) Sets the value ofBucketDeploymentProps.getCacheControl()
contentDisposition
(String contentDisposition) Sets the value ofBucketDeploymentProps.getContentDisposition()
contentEncoding
(String contentEncoding) Sets the value ofBucketDeploymentProps.getContentEncoding()
contentLanguage
(String contentLanguage) Sets the value ofBucketDeploymentProps.getContentLanguage()
contentType
(String contentType) Sets the value ofBucketDeploymentProps.getContentType()
destinationBucket
(IBucket destinationBucket) Sets the value ofBucketDeploymentProps.getDestinationBucket()
destinationKeyPrefix
(String destinationKeyPrefix) Sets the value ofBucketDeploymentProps.getDestinationKeyPrefix()
distribution
(IDistribution distribution) Sets the value ofBucketDeploymentProps.getDistribution()
distributionPaths
(List<String> distributionPaths) Sets the value ofBucketDeploymentProps.getDistributionPaths()
ephemeralStorageSize
(Size ephemeralStorageSize) Sets the value ofBucketDeploymentProps.getEphemeralStorageSize()
Sets the value ofBucketDeploymentProps.getExclude()
expires
(Expiration expires) Sets the value ofBucketDeploymentProps.getExpires()
Sets the value ofBucketDeploymentProps.getExtract()
Sets the value ofBucketDeploymentProps.getInclude()
Sets the value ofBucketDeploymentProps.getLogGroup()
logRetention
(RetentionDays logRetention) Sets the value ofBucketDeploymentProps.getLogRetention()
memoryLimit
(Number memoryLimit) Sets the value ofBucketDeploymentProps.getMemoryLimit()
Sets the value ofBucketDeploymentProps.getMetadata()
outputObjectKeys
(Boolean outputObjectKeys) Sets the value ofBucketDeploymentProps.getOutputObjectKeys()
Sets the value ofBucketDeploymentProps.getPrune()
retainOnDelete
(Boolean retainOnDelete) Sets the value ofBucketDeploymentProps.getRetainOnDelete()
Sets the value ofBucketDeploymentProps.getRole()
serverSideEncryption
(ServerSideEncryption serverSideEncryption) Sets the value ofBucketDeploymentProps.getServerSideEncryption()
serverSideEncryptionAwsKmsKeyId
(String serverSideEncryptionAwsKmsKeyId) Sets the value ofBucketDeploymentProps.getServerSideEncryptionAwsKmsKeyId()
serverSideEncryptionCustomerAlgorithm
(String serverSideEncryptionCustomerAlgorithm) Sets the value ofBucketDeploymentProps.getServerSideEncryptionCustomerAlgorithm()
signContent
(Boolean signContent) Sets the value ofBucketDeploymentProps.getSignContent()
Sets the value ofBucketDeploymentProps.getSources()
storageClass
(StorageClass storageClass) Sets the value ofBucketDeploymentProps.getStorageClass()
Sets the value ofBucketDeploymentProps.getUseEfs()
Sets the value ofBucketDeploymentProps.getVpc()
vpcSubnets
(SubnetSelection vpcSubnets) Sets the value ofBucketDeploymentProps.getVpcSubnets()
websiteRedirectLocation
(String websiteRedirectLocation) Sets the value ofBucketDeploymentProps.getWebsiteRedirectLocation()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
destinationBucket
@Stability(Stable) public BucketDeploymentProps.Builder destinationBucket(IBucket destinationBucket) Sets the value ofBucketDeploymentProps.getDestinationBucket()
- Parameters:
destinationBucket
- The S3 bucket to sync the contents of the zip file to. This parameter is required.- Returns:
this
-
sources
Sets the value ofBucketDeploymentProps.getSources()
- Parameters:
sources
- The sources from which to deploy the contents of this bucket. This parameter is required.- Returns:
this
-
accessControl
@Stability(Stable) public BucketDeploymentProps.Builder accessControl(BucketAccessControl accessControl) Sets the value ofBucketDeploymentProps.getAccessControl()
- Parameters:
accessControl
- System-defined x-amz-acl metadata to be set on all objects in the deployment.- Returns:
this
-
cacheControl
@Stability(Stable) public BucketDeploymentProps.Builder cacheControl(List<? extends CacheControl> cacheControl) Sets the value ofBucketDeploymentProps.getCacheControl()
- Parameters:
cacheControl
- System-defined cache-control metadata to be set on all objects in the deployment.- Returns:
this
-
contentDisposition
@Stability(Stable) public BucketDeploymentProps.Builder contentDisposition(String contentDisposition) Sets the value ofBucketDeploymentProps.getContentDisposition()
- Parameters:
contentDisposition
- System-defined cache-disposition metadata to be set on all objects in the deployment.- Returns:
this
-
contentEncoding
Sets the value ofBucketDeploymentProps.getContentEncoding()
- Parameters:
contentEncoding
- System-defined content-encoding metadata to be set on all objects in the deployment.- Returns:
this
-
contentLanguage
Sets the value ofBucketDeploymentProps.getContentLanguage()
- Parameters:
contentLanguage
- System-defined content-language metadata to be set on all objects in the deployment.- Returns:
this
-
contentType
Sets the value ofBucketDeploymentProps.getContentType()
- Parameters:
contentType
- System-defined content-type metadata to be set on all objects in the deployment.- Returns:
this
-
destinationKeyPrefix
@Stability(Stable) public BucketDeploymentProps.Builder destinationKeyPrefix(String destinationKeyPrefix) Sets the value ofBucketDeploymentProps.getDestinationKeyPrefix()
- Parameters:
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.- Returns:
this
-
distribution
Sets the value ofBucketDeploymentProps.getDistribution()
- Parameters:
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.- Returns:
this
-
distributionPaths
@Stability(Stable) public BucketDeploymentProps.Builder distributionPaths(List<String> distributionPaths) Sets the value ofBucketDeploymentProps.getDistributionPaths()
- Parameters:
distributionPaths
- The file paths to invalidate in the CloudFront distribution.- Returns:
this
-
ephemeralStorageSize
@Stability(Stable) public BucketDeploymentProps.Builder ephemeralStorageSize(Size ephemeralStorageSize) Sets the value ofBucketDeploymentProps.getEphemeralStorageSize()
- Parameters:
ephemeralStorageSize
- The size of the AWS Lambda function’s /tmp directory in MiB.- Returns:
this
-
exclude
Sets the value ofBucketDeploymentProps.getExclude()
- Parameters:
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.- Returns:
this
-
expires
Sets the value ofBucketDeploymentProps.getExpires()
- Parameters:
expires
- System-defined expires metadata to be set on all objects in the deployment.- Returns:
this
-
extract
Sets the value ofBucketDeploymentProps.getExtract()
- Parameters:
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.- Returns:
this
-
include
Sets the value ofBucketDeploymentProps.getInclude()
- Parameters:
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 anexclude
filter.- Returns:
this
-
logGroup
Sets the value ofBucketDeploymentProps.getLogGroup()
- Parameters:
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.- Returns:
this
-
logRetention
Sets the value ofBucketDeploymentProps.getLogRetention()
- Parameters:
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 tologGroup
if you can.logGroup
allows you to create a fully customizable log group and instruct the Lambda function to send logs to it.- Returns:
this
-
memoryLimit
Sets the value ofBucketDeploymentProps.getMemoryLimit()
- 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. If you are deploying large files, you will need to increase this number accordingly.- Returns:
this
-
metadata
Sets the value ofBucketDeploymentProps.getMetadata()
- Parameters:
metadata
- User-defined object metadata to be set on all objects in the deployment.- Returns:
this
-
outputObjectKeys
Sets the value ofBucketDeploymentProps.getOutputObjectKeys()
- Parameters:
outputObjectKeys
- If set to false, the custom resource will not send back the SourceObjectKeys. This is useful when you are facing the errorResponse object is too long
See https://github.com/aws/aws-cdk/issues/28579
- Returns:
this
-
prune
Sets the value ofBucketDeploymentProps.getPrune()
- 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. 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).- Returns:
this
-
retainOnDelete
Sets the value ofBucketDeploymentProps.getRetainOnDelete()
- Parameters:
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.- Returns:
this
-
role
Sets the value ofBucketDeploymentProps.getRole()
- Parameters:
role
- Execution role associated with this function.- Returns:
this
-
serverSideEncryption
@Stability(Stable) public BucketDeploymentProps.Builder serverSideEncryption(ServerSideEncryption serverSideEncryption) Sets the value ofBucketDeploymentProps.getServerSideEncryption()
- Parameters:
serverSideEncryption
- System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment.- Returns:
this
-
serverSideEncryptionAwsKmsKeyId
@Stability(Stable) public BucketDeploymentProps.Builder serverSideEncryptionAwsKmsKeyId(String serverSideEncryptionAwsKmsKeyId) Sets the value ofBucketDeploymentProps.getServerSideEncryptionAwsKmsKeyId()
- Parameters:
serverSideEncryptionAwsKmsKeyId
- System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment.- Returns:
this
-
serverSideEncryptionCustomerAlgorithm
@Stability(Stable) public BucketDeploymentProps.Builder serverSideEncryptionCustomerAlgorithm(String serverSideEncryptionCustomerAlgorithm) Sets the value ofBucketDeploymentProps.getServerSideEncryptionCustomerAlgorithm()
- Parameters:
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- Returns:
this
-
signContent
Sets the value ofBucketDeploymentProps.getSignContent()
- Parameters:
signContent
- If set to true, uploads will precompute the value ofx-amz-content-sha256
and include it in the signed S3 request headers.- Returns:
this
-
storageClass
Sets the value ofBucketDeploymentProps.getStorageClass()
- Parameters:
storageClass
- System-defined x-amz-storage-class metadata to be set on all objects in the deployment.- Returns:
this
-
useEfs
Sets the value ofBucketDeploymentProps.getUseEfs()
- Parameters:
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.- Returns:
this
-
vpc
Sets the value ofBucketDeploymentProps.getVpc()
- Parameters:
vpc
- The VPC network to place the deployment lambda handler in. This is required ifuseEfs
is set.- Returns:
this
-
vpcSubnets
Sets the value ofBucketDeploymentProps.getVpcSubnets()
- Parameters:
vpcSubnets
- Where in the VPC to place the deployment lambda handler. Only used if 'vpc' is supplied.- Returns:
this
-
websiteRedirectLocation
@Stability(Stable) public BucketDeploymentProps.Builder websiteRedirectLocation(String websiteRedirectLocation) Sets the value ofBucketDeploymentProps.getWebsiteRedirectLocation()
- Parameters:
websiteRedirectLocation
- System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<BucketDeploymentProps>
- Returns:
- a new instance of
BucketDeploymentProps
- Throws:
NullPointerException
- if any required attribute was not provided
-