-
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
Hotswap doesn't update SSM parameter environment variables properly #25387
Comments
According to this, I believe hotswap has not supported SSM parameter environment variables yet. I am making this p2 feature request and please help us prioritize by upvotes. |
@pahud In this use case, they aren't hotswapping an SSM parameter, but are instead using a dynamic references to specify an environment variable on a lambda function. When we're hotswapping, we're not using CloudFormation deploy, we're using the Lambda API
I'm not sure there's a good solution here that works both for CloudFormation deployments and for hotswapping |
…properly (#26382) Closes #25387 Closes #25483 The actual value for a CfnParameter backed by a SSM parameter is returned via `ResolvedValue` (and only for SSM parameters, [doc](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html#API_Parameter_Contents)). We use the field from DescirbeStacks API response to populate `stackParams`, instead of `ParameterValue`, which is just a parameter's name. As far as I checked it is not a breaking change. The `parameter` field is not a public API, and internally the values of SSM parameters are only used for hotswap. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…properly (aws#26382) Closes aws#25387 Closes aws#25483 The actual value for a CfnParameter backed by a SSM parameter is returned via `ResolvedValue` (and only for SSM parameters, [doc](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html#API_Parameter_Contents)). We use the field from DescirbeStacks API response to populate `stackParams`, instead of `ParameterValue`, which is just a parameter's name. As far as I checked it is not a breaking change. The `parameter` field is not a public API, and internally the values of SSM parameters are only used for hotswap. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Describe the bug
My lambda function is like the following.
new NodejsFunction(this, "some-id", { environment: { VAR1: StringParameter.valueForStringParameter(this, "/au/parameter/cool-parameter") } })
If I deploy the function before and apply hotswap, the deployment works fine. However, if I add a new environment variable to the function and use hotswap to deploy it. The value of the variable VAR1 is resolved to the path (i.e.
/au/parameter/cool-parameter
) instead of the true value in the parameter store.Expected Behavior
CDK should be able to resolve the right SSM parameter value.
Current Behavior
The value of the variable VAR1 is resolved to the path (i.e.
/au/parameter/cool-parameter
) instead of the true value in the parameter store.Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.69.0
Framework Version
No response
Node.js Version
16
OS
macOS Ventura 13.2.1
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: