goformation
goformation copied to clipboard
Can't use parameters of type `List<>`
I'd like to define a template parameter as List<AWS::EC2::Subnet::Id>
but I can't set directly Subnets: cloudformation.Ref("SubnetIds")
as expected API type is []string
while Ref
return a single string
.
I tried using []string{ cloudformation.Split(",", cloudformation.Ref("SubnetIds"))
, this produces template:
"Subnets": [
{
"Fn::Split": [
",",
{
"Ref": "SubnetIds"
}
]
}
]
This seems valid to me, but fail to validate : ValidationError: Template error: every Fn::Split object requires two parameters, (1) a string delimiter and (2) a string to be split or a function that returns a string to be split.
Did I miss something ? Is there a better approach to manage List<>
references ?
@ndeloof did you solved that issue maybe?
nope
I need also to achieve this - seems that cloudformation.Split(",", cloudformation.Ref("SubnetIds")
is incorrect from the perspective of cloudformation. Second side is that goformation is expecting []string
probably in this place it should be replaced to interface{}
@ndeloof I solved that problem - please take a look on #309 and then use just cloudformation.Join(",", cloudformation.Ref("SubnetIds"))
<- this will return String [A,B]
- then you can use split, select etc