cloudformation-template-generator icon indicating copy to clipboard operation
cloudformation-template-generator copied to clipboard

`AWS::CloudFormation::Stack` should at least take Map[String, Token[String]]

Open bkrodgers opened this issue 9 years ago • 2 comments

Right now AWS::CloudFormation::Stack takes [Map[String, String]], which only allows for hard coded parameter values. At the very least, we want values to be a Token[String] so that we can reference parameters to this template that we want to pass through to the nested template.

Even this isn't perfect, however, since we have parameter types that are typed more strongly than string. For example, to pass a CidrBlockParameter through, we'd have to "convert" it to a StringParameter as follows:

ParameterRef(StringParameter(vpcCidrParameter.name))

This seems hacky, especially since the "conversion" here is only to satisfy the type system...the underlying JSON generated is the same. Should see if we can come up with some implicit conversions.

bkrodgers avatar Jul 14 '16 23:07 bkrodgers

Is there a workaround for this? I currently need to do the following, but It doesn't look possible.

Parameters": {
    "SubnetId" : { "Fn::GetAtt" : [ "Network", "Outputs.SubnetId" ] },
 }

zodeus avatar Aug 26 '16 20:08 zodeus

Thanks @tylersouthwick for the change to take Map[String, Token[String]]. I've merged that in.

I'm going to keep this issue open for now though, as I'm still thinking I may want to add some implicit conversions or otherwise handle the fact that even with this change, a CidrBlockParameter would need to be passed as ParameterRef(StringParameter(vpcCidrParameter.name))

bkrodgers avatar Nov 30 '16 22:11 bkrodgers