-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
aws-ssm: update Parameter Store Tags without overwriting the values #25949
Comments
This is because when you update the Tags property of the secret, cloudformation trigger resource update for you and it will fix the drift if you previously modify its value from CLI or console after initial deployment. When you modify Tags in AWS console it literally update the Tags value through the SDK and other properties will be untouched. I think it's an expected behavior of how cloudformation works. If we really need to update Tags with everything else untouched we probably need to implement a custom resource or something like hotswap that just update the Tags and bypass the cloudformation deployment. |
Yeah this is just how deploying CloudFormation templates works - they are deterministic, so if you specify your StringParameter to be this way, then it will be this way after deployment. @pahud I don't think we'll offer a way to work around this, since you probably shouldn't be planning to introduce drift in your app. @adam-nielsen if you have further concerns, please open a discussion |
|
Discussion opened: #26033 |
Describe the bug
If you change tags for a Parameter Store entry via CDK, the current value gets overwritten with the original value. This causes any passwords etc. that have been entered into Parameter Store entries to be lost.
If you perform the same tag change via the AWS CLI or AWS Console, the value is left unchanged and no data is lost.
Expected Behavior
The Parameter Store value should be left unchanged when it is not being modified in the CDK stack.
Current Behavior
The Parameter Store value is changed back to whatever is specified in the CDK template. It is not possible to omit it from the CDK template as it is mandatory.
Reproduction Steps
Deploy that, and a Parameter Store value will be created called
/example
with the valueTODO
.Go into the AWS Console and change the value from
TODO
to something else, as you would normally do once you are given a password etc. for the system to use.Then change the CDK template, to modify
SampleValue
toSampleValue2
. This should update the tag, without changing the actual Parameter Store entry.Observe that after deploying the updated stack, the value has returned to
TODO
, causing the value you entered earlier to be lost.Possible Solution
Since the AWS Console can modify tags without disrupting the current value, CDK should use the same method to deploy updates to tags without changing the current value of the Parameter Store entry.
Additional Information/Context
No response
CDK CLI Version
2.83.0 (build 0fd7f2b)
Framework Version
No response
Node.js Version
Any
OS
Linux
Language
Typescript
Language Version
Any
Other information
No response
The text was updated successfully, but these errors were encountered: