-
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
Getting latest version of the SSM parameter #1587
Comments
This is unfortunately not supported by CloudFormation using that construct for it. If you use a Secrets Manager value, you can retrieve the latest version. However, you may be able to use a |
Thanks, const { SSMParameterProvider } = require("@aws-cdk/cdk");
value = new SSMParameterProvider(this, {
parameterName: "/xxx/xxx",
}).parameterValue(); |
Ah yes, forgot about that one. It does something slightly different: it caches the retrieved value in cdk.json, so be aware of that when you want to update. |
Here's an example of how to use a parameter to read the latest version from the SSMPS. const amiId = new cdk.Parameter(this,
'AmiId',
{
type: 'AWS::SSM::Parameter::Value<String>',
default: '/ami/sandbox/spark-standalone'
}).ref; |
There are many requests from people to integrate with SSM parameter store in same way, and in particular to get the latest version of a parameter. The mechanisms to get a specific version or the latest version at deployment time are very different, but both are now supported by and hidden in the ssm.ParameterStoreString class. Make the naming around properties that return a (potentially Tokenized) value consistent. All properties of objects that return a string value are `stringValue`, all properties of objects taht return a list value are `stringListValue`. Fixes #1587. BREAKING CHANGE: Rename `parameter.valueAsString` => `parameter.stringValue`, rename `parameter.valueAsList` => `parameter.stringListValue`, rename `ssmParameter.parameterValue` => `ssmParameter.stringValue` or `ssmParameter.stringListValue` depending on type, rename `secretString.value` => `secretString.stringValue`.
There are many requests from people to integrate with SSM parameter store in same way, and in particular to get the latest version of a parameter. The mechanisms to get a specific version or the latest version at deployment time are very different, but both are now supported by and hidden in the ssm.ParameterStoreString class. Make the naming around properties that return a (potentially tokenized) value consistent. All properties of objects that return a string value are `stringValue`, all properties of objects that return a list value are `stringListValue`. Fixes #1587. BREAKING CHANGE: Rename `parameter.valueAsString` => `parameter.stringValue`, rename `parameter.valueAsList` => `parameter.stringListValue`, rename `ssmParameter.parameterValue` => `ssmParameter.stringValue` or `ssmParameter.stringListValue` depending on type, rename `secretString.value` => `secretString.stringValue`, rename `secret.toSecretString()` =>`secret.secretString`
Version for ParameterStoreStringProps is mandatory and number.
https://awslabs.github.io/aws-cdk/refs/_aws-cdk_aws-ssm.html#parameterstorestringprops-interface
I want to get the latest version of the parameter value.
The text was updated successfully, but these errors were encountered: