Skip to content

SSM StringParameter should query multiple paths #7259

@brettswift

Description

@brettswift

The ability to look up multiple SSM paths to satisfy a construct.

Use Case

In our applications we have a ../common/.. pathing and ../<namespace>/.. pathing in ssm values, where <namespace> comes from a cdk context variable -c namespace=bswift.

The pattern is pretty common, grab all the defaults for that account and if I want something special on my deploy - then just set that one value.

This doesn't work with CDK as ValidationErrors are thrown.

Proposed Solution

const value = ssm.StringParameter.valueFromLookup(this, 
     [
        '/service/common/value', 
        '/service/bswift/value'
    ]
  )

Or something to that effect.

Currently neither valueFromLookup or fromStringParameterName allow me to do my own null checking so I'm not sure if there's a workaround internal to CDK. The only thing I can think of is to do it outside and use a context parameter. It would be nice if I could do this within the Construct.

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

This is a 🚀 Feature Request

Metadata

Metadata

Labels

@aws-cdk/aws-ssmRelated to AWS Systems Managerclosed-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.p2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions