public static final class BucketDeployment.Builder
extends java.lang.Object
BucketDeployment
.Modifier and Type | Method and Description |
---|---|
BucketDeployment.Builder |
accessControl(BucketAccessControl accessControl)
System-defined x-amz-acl metadata to be set on all objects in the deployment.
|
BucketDeployment |
build() |
BucketDeployment.Builder |
cacheControl(java.util.List<? extends CacheControl> cacheControl)
System-defined cache-control metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
contentDisposition(java.lang.String contentDisposition)
System-defined cache-disposition metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
contentEncoding(java.lang.String contentEncoding)
System-defined content-encoding metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
contentLanguage(java.lang.String contentLanguage)
System-defined content-language metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
contentType(java.lang.String contentType)
System-defined content-type metadata to be set on all objects in the deployment.
|
static BucketDeployment.Builder |
create(software.constructs.Construct scope,
java.lang.String id) |
BucketDeployment.Builder |
destinationBucket(IBucket destinationBucket)
The S3 bucket to sync the contents of the zip file to.
|
BucketDeployment.Builder |
destinationKeyPrefix(java.lang.String destinationKeyPrefix)
Key prefix in the destination bucket.
|
BucketDeployment.Builder |
distribution(IDistribution distribution)
The CloudFront distribution using the destination bucket as an origin.
|
BucketDeployment.Builder |
distributionPaths(java.util.List<java.lang.String> distributionPaths)
The file paths to invalidate in the CloudFront distribution.
|
BucketDeployment.Builder |
ephemeralStorageSize(Size ephemeralStorageSize)
The size of the AWS Lambda function’s /tmp directory in MiB.
|
BucketDeployment.Builder |
exclude(java.util.List<java.lang.String> exclude)
If this is set, matching files or objects will be excluded from the deployment's sync command.
|
BucketDeployment.Builder |
expires(Expiration expires)
System-defined expires metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
include(java.util.List<java.lang.String> include)
If this is set, matching files or objects will be included with the deployment's sync command.
|
BucketDeployment.Builder |
logRetention(RetentionDays logRetention)
The number of days that the lambda function's log events are kept in CloudWatch Logs.
|
BucketDeployment.Builder |
memoryLimit(java.lang.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.
|
BucketDeployment.Builder |
metadata(UserDefinedObjectMetadata metadata)
User-defined object metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
prune(java.lang.Boolean prune)
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).
|
BucketDeployment.Builder |
retainOnDelete(java.lang.Boolean retainOnDelete)
If this is set to "false", the destination files will be deleted when the resource is deleted or the destination is updated.
|
BucketDeployment.Builder |
role(IRole role)
Execution role associated with this function.
|
BucketDeployment.Builder |
serverSideEncryption(ServerSideEncryption serverSideEncryption)
System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
serverSideEncryptionAwsKmsKeyId(java.lang.String serverSideEncryptionAwsKmsKeyId)
System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
serverSideEncryptionCustomerAlgorithm(java.lang.String serverSideEncryptionCustomerAlgorithm)
System-defined x-amz-server-side-encryption-customer-algorithm metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
sources(java.util.List<? extends ISource> sources)
The sources from which to deploy the contents of this bucket.
|
BucketDeployment.Builder |
storageClass(StorageClass storageClass)
System-defined x-amz-storage-class metadata to be set on all objects in the deployment.
|
BucketDeployment.Builder |
useEfs(java.lang.Boolean useEfs)
Mount an EFS file system.
|
BucketDeployment.Builder |
vpc(IVpc vpc)
The VPC network to place the deployment lambda handler in.
|
BucketDeployment.Builder |
vpcSubnets(SubnetSelection vpcSubnets)
Where in the VPC to place the deployment lambda handler.
|
BucketDeployment.Builder |
websiteRedirectLocation(java.lang.String websiteRedirectLocation)
System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment.
|
public static BucketDeployment.Builder create(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.BucketDeployment.Builder
.public BucketDeployment.Builder destinationBucket(IBucket destinationBucket)
destinationBucket
- The S3 bucket to sync the contents of the zip file to. This parameter is required.this
public BucketDeployment.Builder sources(java.util.List<? extends ISource> sources)
sources
- The sources from which to deploy the contents of this bucket. This parameter is required.this
public BucketDeployment.Builder accessControl(BucketAccessControl accessControl)
Default: - Not set.
accessControl
- System-defined x-amz-acl metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder cacheControl(java.util.List<? extends CacheControl> cacheControl)
Default: - Not set.
cacheControl
- System-defined cache-control metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder contentDisposition(java.lang.String contentDisposition)
Default: - Not set.
contentDisposition
- System-defined cache-disposition metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder contentEncoding(java.lang.String contentEncoding)
Default: - Not set.
contentEncoding
- System-defined content-encoding metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder contentLanguage(java.lang.String contentLanguage)
Default: - Not set.
contentLanguage
- System-defined content-language metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder contentType(java.lang.String contentType)
Default: - Not set.
contentType
- System-defined content-type metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder destinationKeyPrefix(java.lang.String destinationKeyPrefix)
Must be <=104 characters
Default: "/" (unzip to root of the destination bucket)
destinationKeyPrefix
- Key prefix in the destination bucket. This parameter is required.this
public BucketDeployment.Builder distribution(IDistribution distribution)
Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
Default: - No invalidation occurs
distribution
- The CloudFront distribution using the destination bucket as an origin. This parameter is required.this
public BucketDeployment.Builder distributionPaths(java.util.List<java.lang.String> distributionPaths)
Default: - All files under the destination bucket key prefix will be invalidated.
distributionPaths
- The file paths to invalidate in the CloudFront distribution. This parameter is required.this
public BucketDeployment.Builder ephemeralStorageSize(Size ephemeralStorageSize)
Default: 512 MiB
ephemeralStorageSize
- The size of the AWS Lambda function’s /tmp directory in MiB. This parameter is required.this
public BucketDeployment.Builder exclude(java.util.List<java.lang.String> exclude)
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 of
AssetOptions
when defining your source.
Default: - No exclude filters are used
exclude
- If this is set, matching files or objects will be excluded from the deployment's sync command. This parameter is required.this
public BucketDeployment.Builder expires(Expiration expires)
Default: - The objects in the distribution will not expire.
expires
- System-defined expires metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder include(java.util.List<java.lang.String> include)
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
include
- If this is set, matching files or objects will be included with the deployment's sync command. This parameter is required.this
public BucketDeployment.Builder logRetention(RetentionDays logRetention)
Default: logs.RetentionDays.INFINITE
logRetention
- The number of days that the lambda function's log events are kept in CloudWatch Logs. This parameter is required.this
public BucketDeployment.Builder memoryLimit(java.lang.Number memoryLimit)
If you are deploying large files, you will need to increase this number accordingly.
Default: 128
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.this
public BucketDeployment.Builder metadata(UserDefinedObjectMetadata metadata)
Default: - No user metadata is set
metadata
- User-defined object metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder prune(java.lang.Boolean prune)
Default: true
prune
- 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). This parameter is required.this
public BucketDeployment.Builder retainOnDelete(java.lang.Boolean retainOnDelete)
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
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.this
public BucketDeployment.Builder role(IRole role)
Default: - A role is automatically created
role
- Execution role associated with this function. This parameter is required.this
public BucketDeployment.Builder serverSideEncryption(ServerSideEncryption serverSideEncryption)
Default: - Server side encryption is not used.
serverSideEncryption
- System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder serverSideEncryptionAwsKmsKeyId(java.lang.String serverSideEncryptionAwsKmsKeyId)
Default: - Not set.
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.this
public BucketDeployment.Builder serverSideEncryptionCustomerAlgorithm(java.lang.String serverSideEncryptionCustomerAlgorithm)
Warning: This is not a useful parameter until this bug is fixed: https://github.com/aws/aws-cdk/issues/6080
Default: - Not set.
serverSideEncryptionCustomerAlgorithm
- System-defined x-amz-server-side-encryption-customer-algorithm metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder storageClass(StorageClass storageClass)
Default: - Default storage-class for the bucket is used.
storageClass
- System-defined x-amz-storage-class metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment.Builder useEfs(java.lang.Boolean useEfs)
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.
useEfs
- Mount an EFS file system. This parameter is required.this
public BucketDeployment.Builder vpc(IVpc vpc)
This is required if useEfs
is set.
Default: None
vpc
- The VPC network to place the deployment lambda handler in. This parameter is required.this
public BucketDeployment.Builder vpcSubnets(SubnetSelection vpcSubnets)
Only used if 'vpc' is supplied.
Default: - the Vpc default strategy if not specified
vpcSubnets
- Where in the VPC to place the deployment lambda handler. This parameter is required.this
public BucketDeployment.Builder websiteRedirectLocation(java.lang.String websiteRedirectLocation)
Default: - No website redirection.
websiteRedirectLocation
- System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment. This parameter is required.this
public BucketDeployment build()