Class BucketDeploymentProps
Properties for BucketDeployment
.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.S3.Deployment
Assembly: Amazon.CDK.AWS.S3.Deployment.dll
Syntax (csharp)
public class BucketDeploymentProps : Object, IBucketDeploymentProps
Syntax (vb)
Public Class BucketDeploymentProps
Inherits Object
Implements IBucketDeploymentProps
Remarks
ExampleMetadata: infused
Examples
Bucket websiteBucket;
var deployment = new BucketDeployment(this, "DeployWebsite", new BucketDeploymentProps {
Sources = new [] { Source.Asset(Join(__dirname, "my-website")) },
DestinationBucket = websiteBucket
});
new ConstructThatReadsFromTheBucket(this, "Consumer", new Dictionary<string, IBucket> {
// Use 'deployment.deployedBucket' instead of 'websiteBucket' here
{ "bucket", deployment.DeployedBucket }
});
Synopsis
Constructors
BucketDeploymentProps() |
Properties
AccessControl | System-defined x-amz-acl metadata to be set on all objects in the deployment. |
CacheControl | System-defined cache-control metadata to be set on all objects in the deployment. |
ContentDisposition | System-defined cache-disposition metadata to be set on all objects in the deployment. |
ContentEncoding | System-defined content-encoding metadata to be set on all objects in the deployment. |
ContentLanguage | System-defined content-language metadata to be set on all objects in the deployment. |
ContentType | System-defined content-type metadata to be set on all objects in the deployment. |
DestinationBucket | The S3 bucket to sync the contents of the zip file to. |
DestinationKeyPrefix | Key prefix in the destination bucket. |
Distribution | The CloudFront distribution using the destination bucket as an origin. |
DistributionPaths | The file paths to invalidate in the CloudFront distribution. |
EphemeralStorageSize | The size of the AWS Lambda function’s /tmp directory in MiB. |
Exclude | If this is set, matching files or objects will be excluded from the deployment's sync command. |
Expires | System-defined expires metadata to be set on all objects in the deployment. |
Include | If this is set, matching files or objects will be included with the deployment's sync command. |
LogRetention | The number of days that the lambda function's log events are kept in CloudWatch Logs. |
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. |
Metadata | User-defined object metadata to be set on all objects in the deployment. |
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). |
RetainOnDelete | If this is set to "false", the destination files will be deleted when the resource is deleted or the destination is updated. |
Role | Execution role associated with this function. |
ServerSideEncryption | System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment. |
ServerSideEncryptionAwsKmsKeyId | System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment. |
ServerSideEncryptionCustomerAlgorithm | System-defined x-amz-server-side-encryption-customer-algorithm metadata to be set on all objects in the deployment. |
Sources | The sources from which to deploy the contents of this bucket. |
StorageClass | System-defined x-amz-storage-class metadata to be set on all objects in the deployment. |
UseEfs | Mount an EFS file system. |
Vpc | The VPC network to place the deployment lambda handler in. |
VpcSubnets | Where in the VPC to place the deployment lambda handler. |
WebsiteRedirectLocation | System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment. |
Constructors
BucketDeploymentProps()
public BucketDeploymentProps()
Properties
AccessControl
System-defined x-amz-acl metadata to be set on all objects in the deployment.
public Nullable<BucketAccessControl> AccessControl { get; set; }
Property Value
System.Nullable<BucketAccessControl>
Remarks
Default: - Not set.
See: https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl
CacheControl
System-defined cache-control metadata to be set on all objects in the deployment.
public CacheControl[] CacheControl { get; set; }
Property Value
Remarks
Default: - Not set.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
ContentDisposition
System-defined cache-disposition metadata to be set on all objects in the deployment.
public string ContentDisposition { get; set; }
Property Value
System.String
Remarks
Default: - Not set.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
ContentEncoding
System-defined content-encoding metadata to be set on all objects in the deployment.
public string ContentEncoding { get; set; }
Property Value
System.String
Remarks
Default: - Not set.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
ContentLanguage
System-defined content-language metadata to be set on all objects in the deployment.
public string ContentLanguage { get; set; }
Property Value
System.String
Remarks
Default: - Not set.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
ContentType
System-defined content-type metadata to be set on all objects in the deployment.
public string ContentType { get; set; }
Property Value
System.String
Remarks
Default: - Not set.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
DestinationBucket
The S3 bucket to sync the contents of the zip file to.
public IBucket DestinationBucket { get; set; }
Property Value
DestinationKeyPrefix
Key prefix in the destination bucket.
public string DestinationKeyPrefix { get; set; }
Property Value
System.String
Remarks
Must be <=104 characters
Default: "/" (unzip to root of the destination bucket)
Distribution
The CloudFront distribution using the destination bucket as an origin.
public IDistribution Distribution { get; set; }
Property Value
Remarks
Files in the distribution's edge caches will be invalidated after files are uploaded to the destination bucket.
Default: - No invalidation occurs
DistributionPaths
The file paths to invalidate in the CloudFront distribution.
public string[] DistributionPaths { get; set; }
Property Value
System.String[]
Remarks
Default: - All files under the destination bucket key prefix will be invalidated.
EphemeralStorageSize
The size of the AWS Lambda function’s /tmp directory in MiB.
public Size EphemeralStorageSize { get; set; }
Property Value
Remarks
Default: 512 MiB
Exclude
If this is set, matching files or objects will be excluded from the deployment's sync command.
public string[] Exclude { get; set; }
Property Value
System.String[]
Remarks
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
See: https://docs.aws.amazon.com/cli/latest/reference/s3/index.html#use-of-exclude-and-include-filters
Expires
System-defined expires metadata to be set on all objects in the deployment.
public Expiration Expires { get; set; }
Property Value
Remarks
Default: - The objects in the distribution will not expire.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
Include
If this is set, matching files or objects will be included with the deployment's sync command.
public string[] Include { get; set; }
Property Value
System.String[]
Remarks
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
See: https://docs.aws.amazon.com/cli/latest/reference/s3/index.html#use-of-exclude-and-include-filters
LogRetention
The number of days that the lambda function's log events are kept in CloudWatch Logs.
public Nullable<RetentionDays> LogRetention { get; set; }
Property Value
System.Nullable<RetentionDays>
Remarks
Default: logs.RetentionDays.INFINITE
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.
public Nullable<double> MemoryLimit { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
If you are deploying large files, you will need to increase this number accordingly.
Default: 128
Metadata
User-defined object metadata to be set on all objects in the deployment.
public IUserDefinedObjectMetadata Metadata { get; set; }
Property Value
Remarks
Default: - No user metadata is set
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#UserMetadata
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).
public Nullable<bool> Prune { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: true
See: https://docs.aws.amazon.com/cli/latest/reference/s3/sync.html
RetainOnDelete
If this is set to "false", the destination files will be deleted when the resource is deleted or the destination is updated.
public Nullable<bool> RetainOnDelete { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
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
See: https://github.com/aws/aws-cdk/tree/master/packages/%40aws-cdk/aws-s3-deployment#retain-on-delete
Role
Execution role associated with this function.
public IRole Role { get; set; }
Property Value
Remarks
Default: - A role is automatically created
ServerSideEncryption
System-defined x-amz-server-side-encryption metadata to be set on all objects in the deployment.
public Nullable<ServerSideEncryption> ServerSideEncryption { get; set; }
Property Value
System.Nullable<ServerSideEncryption>
Remarks
Default: - Server side encryption is not used.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
ServerSideEncryptionAwsKmsKeyId
System-defined x-amz-server-side-encryption-aws-kms-key-id metadata to be set on all objects in the deployment.
public string ServerSideEncryptionAwsKmsKeyId { get; set; }
Property Value
System.String
Remarks
Default: - Not set.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
ServerSideEncryptionCustomerAlgorithm
System-defined x-amz-server-side-encryption-customer-algorithm metadata to be set on all objects in the deployment.
public string ServerSideEncryptionCustomerAlgorithm { get; set; }
Property Value
System.String
Remarks
Warning: This is not a useful parameter until this bug is fixed: https://github.com/aws/aws-cdk/issues/6080
Default: - Not set.
Sources
The sources from which to deploy the contents of this bucket.
public ISource[] Sources { get; set; }
Property Value
ISource[]
StorageClass
System-defined x-amz-storage-class metadata to be set on all objects in the deployment.
public Nullable<StorageClass> StorageClass { get; set; }
Property Value
System.Nullable<StorageClass>
Remarks
Default: - Default storage-class for the bucket is used.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata
UseEfs
Mount an EFS file system.
public Nullable<bool> UseEfs { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
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.
Vpc
The VPC network to place the deployment lambda handler in.
public IVpc Vpc { get; set; }
Property Value
Remarks
This is required if useEfs
is set.
Default: None
VpcSubnets
Where in the VPC to place the deployment lambda handler.
public ISubnetSelection VpcSubnets { get; set; }
Property Value
Remarks
Only used if 'vpc' is supplied.
Default: - the Vpc default strategy if not specified
WebsiteRedirectLocation
System-defined x-amz-website-redirect-location metadata to be set on all objects in the deployment.
public string WebsiteRedirectLocation { get; set; }
Property Value
System.String
Remarks
Default: - No website redirection.
See: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#SysMetadata