Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can cloudformation SSM dynamic reference with type StringList resolve to list?

Dynamic references to SSM parameters are supported within cloudformation templates

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html

The documentation states that you can Use the ssm dynamic reference to include values stored in the Systems Manager Parameter Store of type String or StringList in your templates.

We are trying to reference a parameter of type StringList in our template using the syntax {{resolve:ssm:parameter-name:version}} and have it resolve to a list of strings in the template (more specifically, a list of SecurityGroupIds for an EC2 instance). This has not worked, and the documentation does not specify how to do this or if it is supported. We have tried using Fn::Split however it appears this gets called before dynamic value gets resolved. We are unable to use SSM values in the parameters section of the template, where this is documented. Does anyone know if it is possible to have {{resolve ... to a list of strings?

like image 409
ekcrisp Avatar asked Apr 05 '19 16:04

ekcrisp


1 Answers

AWS Support has responded to my request about this issue and explained that the answer to my question is no, it is not currently supported. The full text of their response is below.

Currently, CFN can take a StringList type, but such StringList is being returned as comma separated string values resulting in one long string. Therefore, in cases where we need it to become multiple values like an array or list of strings, for example a list of SecurityGroup Ids for an EC2 instance, it is not presently supported.

With that said, I dug further and found we internally have this as an existing feature request to which I have added your voice to help gain more traction for this feature. I do not have an ETA to share as the service team is discreet about their timeline/worklog. However, if/when the feature becomes available, it shall be publicly announced at the following places:

  • AWS What's New: https://aws.amazon.com/new/
  • CloudFormation Release History: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/ReleaseHistory.html
like image 109
ekcrisp Avatar answered Sep 22 '22 01:09

ekcrisp