DeployTimeSubstitutedFileProps

class aws_cdk.aws_s3_deployment.DeployTimeSubstitutedFileProps(*, destination_bucket, source, substitutions, destination_key=None, role=None)

Bases: object

Parameters:
  • destination_bucket (IBucket) – The S3 bucket to sync the contents of the zip file to.

  • source (str) – Path to the user’s local file.

  • substitutions (Mapping[str, str]) – 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.

  • destination_key (Optional[str]) – The object key in the destination bucket where the processed file would be written to. Default: - Fingerprint of the file content would be used as object key

  • role (Optional[IRole]) – Execution role associated with this function. Default: - A role is automatically created

ExampleMetadata:

infused

Example:

import aws_cdk.aws_lambda as lambda_

# my_lambda_function: lambda.Function
# destination_bucket: s3.Bucket
# (Optional) if provided, the resulting processed file would be uploaded to the destinationBucket under the destinationKey name.
# destination_key: str
# role: iam.Role


s3deploy.DeployTimeSubstitutedFile(self, "MyFile",
    source="my-file.yaml",
    destination_key=destination_key,
    destination_bucket=destination_bucket,
    substitutions={
        "variable_name": my_lambda_function.function_name
    },
    role=role
)

Attributes

destination_bucket

The S3 bucket to sync the contents of the zip file to.

destination_key

The object key in the destination bucket where the processed file would be written to.

Default:
  • Fingerprint of the file content would be used as object key

role

Execution role associated with this function.

Default:
  • A role is automatically created

source

Path to the user’s local file.

substitutions

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.