public static final class BucketDeploymentProps.Builder
extends java.lang.Object
BucketDeploymentProps
Constructor and Description |
---|
Builder() |
public BucketDeploymentProps.Builder destinationBucket(IBucket destinationBucket)
BucketDeploymentProps.getDestinationBucket()
destinationBucket
- The S3 bucket to sync the contents of the zip file to. This parameter is required.this
public BucketDeploymentProps.Builder sources(java.util.List<? extends ISource> sources)
BucketDeploymentProps.getSources()
sources
- The sources from which to deploy the contents of this bucket. This parameter is required.this
public BucketDeploymentProps.Builder accessControl(BucketAccessControl accessControl)
BucketDeploymentProps.getAccessControl()
accessControl
- System-defined x-amz-acl metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder cacheControl(java.util.List<? extends CacheControl> cacheControl)
BucketDeploymentProps.getCacheControl()
cacheControl
- System-defined cache-control metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder contentDisposition(java.lang.String contentDisposition)
BucketDeploymentProps.getContentDisposition()
contentDisposition
- System-defined cache-disposition metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder contentEncoding(java.lang.String contentEncoding)
BucketDeploymentProps.getContentEncoding()
contentEncoding
- System-defined content-encoding metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder contentLanguage(java.lang.String contentLanguage)
BucketDeploymentProps.getContentLanguage()
contentLanguage
- System-defined content-language metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder contentType(java.lang.String contentType)
BucketDeploymentProps.getContentType()
contentType
- System-defined content-type metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder destinationKeyPrefix(java.lang.String destinationKeyPrefix)
BucketDeploymentProps.getDestinationKeyPrefix()
destinationKeyPrefix
- Key prefix in the destination bucket.
Must be <=104 charactersthis
public BucketDeploymentProps.Builder distribution(IDistribution distribution)
BucketDeploymentProps.getDistribution()
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.this
public BucketDeploymentProps.Builder distributionPaths(java.util.List<java.lang.String> distributionPaths)
BucketDeploymentProps.getDistributionPaths()
distributionPaths
- The file paths to invalidate in the CloudFront distribution.this
public BucketDeploymentProps.Builder ephemeralStorageSize(Size ephemeralStorageSize)
BucketDeploymentProps.getEphemeralStorageSize()
ephemeralStorageSize
- The size of the AWS Lambda function’s /tmp directory in MiB.this
public BucketDeploymentProps.Builder exclude(java.util.List<java.lang.String> exclude)
BucketDeploymentProps.getExclude()
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 of
AssetOptions
when defining your source.
this
public BucketDeploymentProps.Builder expires(Expiration expires)
BucketDeploymentProps.getExpires()
expires
- System-defined expires metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder include(java.util.List<java.lang.String> include)
BucketDeploymentProps.getInclude()
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.this
public BucketDeploymentProps.Builder logRetention(RetentionDays logRetention)
BucketDeploymentProps.getLogRetention()
logRetention
- The number of days that the lambda function's log events are kept in CloudWatch Logs.this
public BucketDeploymentProps.Builder memoryLimit(java.lang.Number memoryLimit)
BucketDeploymentProps.getMemoryLimit()
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.this
public BucketDeploymentProps.Builder metadata(UserDefinedObjectMetadata metadata)
BucketDeploymentProps.getMetadata()
metadata
- User-defined object metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder prune(java.lang.Boolean prune)
BucketDeploymentProps.getPrune()
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
public BucketDeploymentProps.Builder retainOnDelete(java.lang.Boolean retainOnDelete)
BucketDeploymentProps.getRetainOnDelete()
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.this
public BucketDeploymentProps.Builder role(IRole role)
BucketDeploymentProps.getRole()
role
- Execution role associated with this function.this
public BucketDeploymentProps.Builder serverSideEncryption(ServerSideEncryption serverSideEncryption)
BucketDeploymentProps.getServerSideEncryption()
serverSideEncryption
- System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder serverSideEncryptionAwsKmsKeyId(java.lang.String serverSideEncryptionAwsKmsKeyId)
BucketDeploymentProps.getServerSideEncryptionAwsKmsKeyId()
serverSideEncryptionAwsKmsKeyId
- System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder serverSideEncryptionCustomerAlgorithm(java.lang.String serverSideEncryptionCustomerAlgorithm)
BucketDeploymentProps.getServerSideEncryptionCustomerAlgorithm()
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/6080this
public BucketDeploymentProps.Builder storageClass(StorageClass storageClass)
BucketDeploymentProps.getStorageClass()
storageClass
- System-defined x-amz-storage-class metadata to be set on all objects in the deployment.this
public BucketDeploymentProps.Builder useEfs(java.lang.Boolean useEfs)
BucketDeploymentProps.getUseEfs()
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.this
public BucketDeploymentProps.Builder vpc(IVpc vpc)
BucketDeploymentProps.getVpc()
vpc
- The VPC network to place the deployment lambda handler in.
This is required if useEfs
is set.this
public BucketDeploymentProps.Builder vpcSubnets(SubnetSelection vpcSubnets)
BucketDeploymentProps.getVpcSubnets()
vpcSubnets
- Where in the VPC to place the deployment lambda handler.
Only used if 'vpc' is supplied.this
public BucketDeploymentProps.Builder websiteRedirectLocation(java.lang.String websiteRedirectLocation)
BucketDeploymentProps.getWebsiteRedirectLocation()
websiteRedirectLocation
- System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment.this
public BucketDeploymentProps build()
BucketDeploymentProps
java.lang.NullPointerException
- if any required attribute was not provided