cloudformation-template-generator
cloudformation-template-generator copied to clipboard
`AWS::CloudFormation::Stack` should at least take Map[String, Token[String]]
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.
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" ] },
}
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))