Skip to content

aws-s3-bucket-deployment: lazy values do not work with Source #32767

Open
@agdimech

Description

@agdimech

Describe the bug

When using a Lazy value for any of the Source inputs, they are getting resolved immediately due to bind happening in construction. i.e:

Source.jsonData(
  DEFAULT_RUNTIME_CONFIG_FILENAME,
  Lazy.any({provide => someValue})
)

We should be able to support synthesis time values here also by delaying the source binding until synthesis time.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

No response

Expected Behavior

Lazy values should work when passing them in as Sources to the BucketDeployment

Current Behavior

They are evaluated immediately.

Reproduction Steps

Source.jsonData(
 'myfile.json,
  Lazy.any(produce: () => {console.log('getting called before synth'); return {deferred: 'value'}})
)

Possible Solution

We should be able to support synthesis time values here also by delaying the source binding until synthesis time.

Additional Information/Context

No response

CDK CLI Version

latest

Framework Version

No response

Node.js Version

18

OS

osx

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.effort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p3package/toolsRelated to AWS CDK Tools or CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions