interface DeployTimeSubstitutedFileProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.S3.Deployment.DeployTimeSubstitutedFileProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awss3deployment#DeployTimeSubstitutedFileProps |
Java | software.amazon.awscdk.services.s3.deployment.DeployTimeSubstitutedFileProps |
Python | aws_cdk.aws_s3_deployment.DeployTimeSubstitutedFileProps |
TypeScript (source) | aws-cdk-lib » aws_s3_deployment » DeployTimeSubstitutedFileProps |
Example
import * as lambda from 'aws-cdk-lib/aws-lambda';
declare const myLambdaFunction: lambda.Function;
declare const destinationBucket: s3.Bucket;
//(Optional) if provided, the resulting processed file would be uploaded to the destinationBucket under the destinationKey name.
declare const destinationKey: string;
declare const role: iam.Role;
new s3deploy.DeployTimeSubstitutedFile(this, 'MyFile', {
source: 'my-file.yaml',
destinationKey: destinationKey,
destinationBucket: destinationBucket,
substitutions: {
variableName: myLambdaFunction.functionName,
},
role: role,
});
Properties
Name | Type | Description |
---|---|---|
destination | IBucket | The S3 bucket to sync the contents of the zip file to. |
source | string | Path to the user's local file. |
substitutions | { [string]: string } | User-defined substitutions to make in the file. |
destination | string | The object key in the destination bucket where the processed file would be written to. |
role? | IRole | Execution role associated with this function. |
destinationBucket
Type:
IBucket
The S3 bucket to sync the contents of the zip file to.
source
Type:
string
Path to the user's local file.
substitutions
Type:
{ [string]: string }
User-defined substitutions to make in the file.
Placeholders in the user's local file must be specified with double curly brackets and spaces. For example, if you use the key 'xxxx' in the file, it must be written as: {{ xxxx }} to be recognized by the construct as a substitution.
destinationKey?
Type:
string
(optional, default: Fingerprint of the file content would be used as object key)
The object key in the destination bucket where the processed file would be written to.
role?
Type:
IRole
(optional, default: A role is automatically created)
Execution role associated with this function.