Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(core): stateful annotations #26778

Open
2 tasks
MrArnoldPalmer opened this issue Aug 16, 2023 · 0 comments
Open
2 tasks

(core): stateful annotations #26778

MrArnoldPalmer opened this issue Aug 16, 2023 · 0 comments
Labels
@aws-cdk/core Related to core CDK functionality effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@MrArnoldPalmer
Copy link
Contributor

Describe the feature

I as a construct author, want to be able to change or remove annotations after they have been constructed.

Use Case

For example, the aws-lambda-nodejs.Function construct can use a runtime NODEJS_LATEST, which changes as new runtime versions are available. We currently warn users when they are using this runtime, and have dependencies listed in externalModules, since this indicates that they are relying on these packages being present somewhere other than their bundled handler. However, these dependencies may be present in a lambda layer.

Currently lambda layers are computed lazily which means we can't just check if the runtime is variable, external modules are passed, and there are no layers present within aws-lambda-nodejs.Function then add an annotation, as a user may call addLayers post construction and then the annotation would be inaccurate.

If we could remove an annotation, we could check for these conditions within a constructor, add the annotation, then override addLayers from the inheriting class to remove the annotation if present.

See #26763 for additional context

Proposed Solution

This was explored previously by @corymhall in this pr but it was dropped for the moment as solutions weren't ideal.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.92.0

Environment details (OS name and version, etc.)

MacOs

@MrArnoldPalmer MrArnoldPalmer added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 16, 2023
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Aug 16, 2023
@MrArnoldPalmer MrArnoldPalmer added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 16, 2023
@khushail khushail added the node18-upgrade Any work (bug, feature) related to Node 18 upgrade label Sep 1, 2023
@udaypant udaypant removed the node18-upgrade Any work (bug, feature) related to Node 18 upgrade label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

No branches or pull requests

3 participants