BucketDeploymentProps¶
-
class
aws_cdk.aws_s3_deployment.
BucketDeploymentProps
(*, destination_bucket, sources, cache_control=None, content_disposition=None, content_encoding=None, content_language=None, content_type=None, destination_key_prefix=None, distribution=None, distribution_paths=None, expires=None, memory_limit=None, metadata=None, prune=None, retain_on_delete=None, role=None, server_side_encryption=None, server_side_encryption_aws_kms_key_id=None, server_side_encryption_customer_algorithm=None, storage_class=None, vpc=None, vpc_subnets=None, website_redirect_location=None)¶ Bases:
object
- Parameters
destination_bucket (
IBucket
) – (experimental) The S3 bucket to sync the contents of the zip file to.sources (
List
[ISource
]) – (experimental) The sources from which to deploy the contents of this bucket.cache_control (
Optional
[List
[CacheControl
]]) – (experimental) System-defined cache-control metadata to be set on all objects in the deployment. Default: - Not set.content_disposition (
Optional
[str
]) – (experimental) System-defined cache-disposition metadata to be set on all objects in the deployment. Default: - Not set.content_encoding (
Optional
[str
]) – (experimental) System-defined content-encoding metadata to be set on all objects in the deployment. Default: - Not set.content_language (
Optional
[str
]) – (experimental) System-defined content-language metadata to be set on all objects in the deployment. Default: - Not set.content_type (
Optional
[str
]) – (experimental) System-defined content-type metadata to be set on all objects in the deployment. Default: - Not set.destination_key_prefix (
Optional
[str
]) – (experimental) Key prefix in the destination bucket. Default: “/” (unzip to root of the destination bucket)distribution (
Optional
[IDistribution
]) – (experimental) 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 occursdistribution_paths (
Optional
[List
[str
]]) – (experimental) The file paths to invalidate in the CloudFront distribution. Default: - All files under the destination bucket key prefix will be invalidated.expires (
Optional
[Expiration
]) – (experimental) System-defined expires metadata to be set on all objects in the deployment. Default: - The objects in the distribution will not expire.memory_limit (
Union
[int
,float
,None
]) – (experimental) 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: 128metadata (
Optional
[UserDefinedObjectMetadata
]) – (experimental) User-defined object metadata to be set on all objects in the deployment. Default: - No user metadata is setprune (
Optional
[bool
]) – (experimental) 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: trueretain_on_delete (
Optional
[bool
]) – (experimental) If this is set to “false”, the destination files will be deleted when the resource is deleted or the destination is updated. NOTICE: if this is set to “false” and destination bucket/prefix is updated, all files in the previous destination will first be deleted and then uploaded to the new destination location. This could have availablity implications on your users. Default: true - when resource is deleted/updated, files are retainedrole (
Optional
[IRole
]) – (experimental) Execution role associated with this function. Default: - A role is automatically createdserver_side_encryption (
Optional
[ServerSideEncryption
]) – (experimental) System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment. Default: - Server side encryption is not used.server_side_encryption_aws_kms_key_id (
Optional
[str
]) – (experimental) System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment. Default: - Not set.server_side_encryption_customer_algorithm (
Optional
[str
]) – (experimental) 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.storage_class (
Optional
[StorageClass
]) – (experimental) 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.vpc (
Optional
[IVpc
]) – (experimental) The VPC network to place the deployment lambda handler in. Default: Nonevpc_subnets (
Optional
[SubnetSelection
]) – (experimental) Where in the VPC to place the deployment lambda handler. Only used if ‘vpc’ is supplied. Default: - the Vpc default strategy if not specifiedwebsite_redirect_location (
Optional
[str
]) – (experimental) System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment. Default: - No website redirection.
- Stability
experimental
Attributes
-
cache_control
¶ (experimental) System-defined cache-control metadata to be set on all objects in the deployment.
- Default
Not set.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[List
[CacheControl
]]
-
content_disposition
¶ (experimental) System-defined cache-disposition metadata to be set on all objects in the deployment.
- Default
Not set.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[str
]
-
content_encoding
¶ (experimental) System-defined content-encoding metadata to be set on all objects in the deployment.
- Default
Not set.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[str
]
-
content_language
¶ (experimental) System-defined content-language metadata to be set on all objects in the deployment.
- Default
Not set.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[str
]
-
content_type
¶ (experimental) System-defined content-type metadata to be set on all objects in the deployment.
- Default
Not set.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[str
]
-
destination_bucket
¶ (experimental) The S3 bucket to sync the contents of the zip file to.
- Stability
experimental
- Return type
-
destination_key_prefix
¶ (experimental) Key prefix in the destination bucket.
- Default
“/” (unzip to root of the destination bucket)
- Stability
experimental
- Return type
Optional
[str
]
-
distribution
¶ (experimental) 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
- Stability
experimental
- Return type
Optional
[IDistribution
]
-
distribution_paths
¶ (experimental) The file paths to invalidate in the CloudFront distribution.
- Default
All files under the destination bucket key prefix will be invalidated.
- Stability
experimental
- Return type
Optional
[List
[str
]]
-
expires
¶ (experimental) System-defined expires metadata to be set on all objects in the deployment.
- Default
The objects in the distribution will not expire.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[Expiration
]
-
memory_limit
¶ (experimental) 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
- Stability
experimental
- Return type
Union
[int
,float
,None
]
-
metadata
¶ (experimental) User-defined object metadata to be set on all objects in the deployment.
- Default
No user metadata is set
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#UserMetadata
- Stability
experimental
- Return type
Optional
[UserDefinedObjectMetadata
]
-
prune
¶ (experimental) 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
- See
https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html
- Stability
experimental
- Return type
Optional
[bool
]
-
retain_on_delete
¶ (experimental) If this is set to “false”, the destination files will be deleted when the resource is deleted or the destination is updated.
NOTICE: if this is set to “false” and destination bucket/prefix is updated, all files in the previous destination will first be deleted and then uploaded to the new destination location. This could have availablity implications on your users.
- Default
true - when resource is deleted/updated, files are retained
- Stability
experimental
- Return type
Optional
[bool
]
-
role
¶ (experimental) Execution role associated with this function.
- Default
A role is automatically created
- Stability
experimental
- Return type
Optional
[IRole
]
-
server_side_encryption
¶ (experimental) System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment.
- Default
Server side encryption is not used.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[ServerSideEncryption
]
-
server_side_encryption_aws_kms_key_id
¶ (experimental) System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment.
- Default
Not set.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[str
]
-
server_side_encryption_customer_algorithm
¶ (experimental) 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.
- See
- Stability
experimental
- Return type
Optional
[str
]
-
sources
¶ (experimental) The sources from which to deploy the contents of this bucket.
- Stability
experimental
- Return type
List
[ISource
]
-
storage_class
¶ (experimental) 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.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[StorageClass
]
-
vpc
¶ (experimental) The VPC network to place the deployment lambda handler in.
- Default
None
- Stability
experimental
- Return type
Optional
[IVpc
]
-
vpc_subnets
¶ (experimental) Where in the VPC to place the deployment lambda handler.
Only used if ‘vpc’ is supplied.
- Default
the Vpc default strategy if not specified
- Stability
experimental
- Return type
Optional
[SubnetSelection
]
-
website_redirect_location
¶ (experimental) System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment.
- Default
No website redirection.
- See
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
- Stability
experimental
- Return type
Optional
[str
]