ssm: deploy-time random string generator for Parameter store #30881
Labels
@aws-cdk/aws-ssm
Related to AWS Systems Manager
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
Describe the feature
This is a feature request for Systems Manager Parameter store construct
StringParameter
to generate a random string on deploy-time.Secrets Manager construct (
Secret
) already has this feature and it is useful for generating secrets such as a database password. However, the drawback of Secret Manager is its cost; it costs $0.40/month per secret. Parameter store is a lot cheaper; it incurrs no additional charge for storing a parameter.If we can reliably and deterministically generate a cryptographically-secure random string for a parameter store, it will be a handy way to store secrets.
Use Case
Generate and store an API key or encryption key for an app deployed by CDK.
Proposed Solution
To avoid from any breaking changes, we add a new construct e.g.
GeneratedStringParameter
Generally speaking, each parameter is used to store a single parameter, not an object like JSON, so we only need a simpler API than Secrets Manager. Something like the below should suffice:
The
generateOption
follows the existingSecretStringGenerator
except the template feature, which should meet most use cases.Besides that, the construct should inherit all the props from
StringParameterProps
exceptstringValue
, which will be filled by a random generated string.Inside the construct, we add a custom resource to generate a string and a StringParameter construct:
Other Information
No response
Acknowledgements
CDK version used
2.149.0
Environment details (OS name and version, etc.)
macOS
The text was updated successfully, but these errors were encountered: