-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Improved management of context caching #19797
Copy link
Copy link
Open
Labels
@aws-cdk/coreRelated to core CDK functionalityRelated to core CDK functionality@aws-cdk/custom-resourcesRelated to AWS CDK Custom ResourcesRelated to AWS CDK Custom Resourceseffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2
Metadata
Metadata
Assignees
Labels
@aws-cdk/coreRelated to core CDK functionalityRelated to core CDK functionality@aws-cdk/custom-resourcesRelated to AWS CDK Custom ResourcesRelated to AWS CDK Custom Resourceseffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.p2
Describe the feature
Users need better tooling for managing context caching behaviors and for maintaining
cdk.context.jsoncached values.Use Case
Users regularly open issues regarding stale values being returned by ContextProvider-enabled features (e.g.
Parameter.valueFromLookup). As AWS itself recommends commitingcdk.context.jsonto source control to ensure reproducible builds, additional tooling should support maintaining it as well as control caching behaviors of lookups in general.Proposed Solution
cdk context --reset <key or number>cli command. Allow wildcard key matching and environment-based filtering so unused values can be removed without impacting determinism of the synthesis.If plugin-registered context-providers do eventually leave alpha, consider calling a staleness check with the cached values on context providers to support more complex cache-busting behaviors.
Other Information
No response
Acknowledgements
CDK version used
2.19.0
Environment details (OS name and version, etc.)
Windows 11 (WSL2 Ubuntu 20.04)