-
Notifications
You must be signed in to change notification settings - Fork 4k
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(cli): hotswap to be more tolerant of the Fn::ImportValue
usage
#21320
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.
p1
Comments
3 tasks
I'm working on an implementation of this here: #27292 |
mergify bot
pushed a commit
that referenced
this issue
Oct 19, 2023
…eployments (#27292) ## Purpose 🎯 Extend the `EvaluateCloudFormationTemplate` class to support the `Fn::ImportValue` intrinsic function. This allows for more diverse templates to be evaluated for the purposes of determining eligibility for `--hotswap` deployments Closes #21320 ## Approach 🧠 Implement `LazyLookupExport` in similar fashion to `LazyListStackResources` to cache required CloudFormation API calls _(preference was to implement using a generator function instead so style is not entirely consistent, is this an issue?)_ Add some basic unit tests for `EvaluateCloudFormationTemplate.evaluateCfnExpression()` is they were absent, then add some tests for `Fn::ImportValue` ## Todo 📝 - [x] Update doco where appropriate - [x] Add to hotswap deployment tests - [x] Look for appropriate integration tests to update ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
rix0rrr
pushed a commit
to aws/aws-cdk-cli-testing
that referenced
this issue
Dec 24, 2024
…eployments (#27292) ## Purpose 🎯 Extend the `EvaluateCloudFormationTemplate` class to support the `Fn::ImportValue` intrinsic function. This allows for more diverse templates to be evaluated for the purposes of determining eligibility for `--hotswap` deployments Closes aws/aws-cdk#21320 ## Approach 🧠 Implement `LazyLookupExport` in similar fashion to `LazyListStackResources` to cache required CloudFormation API calls _(preference was to implement using a generator function instead so style is not entirely consistent, is this an issue?)_ Add some basic unit tests for `EvaluateCloudFormationTemplate.evaluateCfnExpression()` is they were absent, then add some tests for `Fn::ImportValue` ## Todo 📝 - [x] Update doco where appropriate - [x] Add to hotswap deployment tests - [x] Look for appropriate integration tests to update ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
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.
p1
Describe the feature
The CDK CLI will refuse to hotswap a resource if its definition contains the intrinsic function
Fn::Import
.This is because the hotswap feature needs the template to be fully resolved in order to correctly determine the changes; and
Fn::ImportValue
is not supported by CDK's resolver function.The hotswap feature should be more tolerant of the
Fn::ImportValue
usage. It should accept the case whereFn::ImportValue
is use and the import name has not changed. This is the case where we can safely assume that the value will not change (thanks to CloudFormation's protection around exported/imported names). To be more specific on the expected behavior:Use Case
Fn::ImportValue
is commonly used by CDK applications. Some users may be using it without knowing it. But as soon as their template uses this intrinsic function, hotswap will stop working.Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
2.33.0 (build 859272d)
Environment details (OS name and version, etc.)
Darwin Kernel Version 21.6.0
The text was updated successfully, but these errors were encountered: