# DeployTimeSubstitutedFileProps

Extends: DeployTimeSubstitutedFileProps
Used as props by: DeployTimeSubstitutedFile

- Source: [`aws-s3-deployment/lib/bucket-deployment.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-s3-deployment/lib/bucket-deployment.ts#L723)
- Type last changed: v2.128.0 · 14 Feb 2024

## Example

```ts
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

- `destinationBucket`: [IBucket](/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html) (required) — The S3 bucket to sync the contents of the zip file to.

- `destinationKey`: string — 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`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — Execution role associated with this function.

  **Default:** A role is automatically created

- `source`: string (required) — Path to the user's local file.

- `substitutions`: { [key: string]: string } (required) — 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.
