Skip to content

SSM: StringParameter.valueFromLookup should return undefined if SSM parameter not available #22064

@astef

Description

@astef

Describe the feature

When using ssm.StringParameter.valueFromLookup, it crashes (not sure, but error is not catchable), when the parameter doesn't exist. It makes it unusable for scenarios with a fallback parameter.

Use Case

For a short-lived infrastructure it's both important to be configurable (create a parameter & deploy), and have a nice fallback value (just deploy). SSM parameter is a perfect solution, since it can be resolved at synth time. It's very unfortunate, that currently it's impossible not to crash, when the value doesn't exist.

Proposed Solution

Return undefined, instead of crashing, or expose a better API, with multiple fallback parameter names to check.

Other Information

This issue was also discussed here: #7259

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2

Environment details (OS name and version, etc.)

Any

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-ssmRelated to AWS Systems ManagerbugThis issue is a bug.closed-for-stalenessThis issue was automatically closed because it hadn't received any attention in a while.effort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p1response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions