[ssm] Programatically Set Parameter Values or Get Secure Values within code
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
Looking at the various ways to get a secure string into my template. I want to make use of the SSM Secure String resolver but this is limited to specific resources which is annoying and for my use case does not work
So I went down the path of creating a Parameter with NoEcho set to true. I now want to be able to set this parameter value programatically - i.e perform a boto3/etc call to get my secure string from SSM and set the value of the Parameter to this value.
I see some old posts about setParameterValue which was removed but I feel like a consistent mechanism to retrieve/pass/set secure values would be very useful.
I find it strange that CDK is all about Cfn yet it seems to ignore the usefulness of core features like using Parameters.
### Use Case
I want to create a construct where a property is sensitive so it should not show up in the synthed output or within the CFN console - but I also want to be able to set the value based on the account the construct is deployed in (in this case, API Keys). ssm-secure Resolver is not supported by the resource directly (it is a Custom Type) so I can not use this.
If I could create a Parameter and set it's value programatically, I would be able to make use of NoEcho for CFN Console output and if the value is retrieved on deploy, I also don't need to store the sensitive value or pass it as a command-line value
### Proposed Solution
Re-implement a working version of SetParameterValue but make it more aware of the context that the App is deployed in.
[Sceptre](https://sceptre.cloudreach.com/2.3.0/docs/resolvers.html) achieves this with the idea of resolvers which can be used as Parameter values, defined in a YAML file - this would allow me to write an SSM Resolver to get a value that is passed as a Parameter value but only on deploy.
Could CDK be expanded so that we have a more native Parameter construct which has the ability to set something like "resolveValue" or pass in some kind of function that will return a value where that function could be what ever we like.
This is a :rocket: Feature Request
Contributor guide
Research direction
Start by reviewing the existing SSM Secure String resolver, CloudFormation Parameters with NoEcho, and the history of SetParameterValue. Compare the proposed deploy-time resolveValue mechanism with Sceptre resolvers; done requires an agreed native approach for retrieving and passing secure values without exposing them in synthesized output or the CloudFormation console.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100