'zed' => 'subnet-0xxxxxxx,subnet-1xxxxxxx'
}
end
This is a valid parameter's allowed_values and it produces this CloudFormation json.
"MyParam": {
"Type": "CommaDelimitedList",
"Default": "subnet-0xxxxxxx,subnet-1xxxxxxx",
"AllowedValues": [
"subnet-0xxxxxxx",
"subnet-1xxxxxxx",
"subnet-2xxxxxxx",
"subnet-3xxxxxxx",
"subnet-4xxxxxxx",
"subnet-5xxxxxxx",
"subnet-0xxxxxxx,subnet-1xxxxxxx"
]
}
Without zed you can see that it would not have a valid match in your original registry. CommaDelimitedList isn't really evaluated as an array or List until it's ref! is used. And allowed_values is only allowed to be a List of Strings
If you're just trying to source a registry of subnet ids and use them for a resource's 'Subnet' property then maybe something list this would work for you.
Your registry could be an array instead of a hash:
SfnRegistry.register(:vpc_subnets_as_array) do
[
'subnet-0xxxxxxx',
'subnet-1xxxxxxx',
'subnet-2xxxxxxx',
'subnet-3xxxxxxx',
'subnet-4xxxxxxx',
'subnet-5xxxxxxx'
]
end
Your template can gather information from the registry
thesubnets = registry!(:vpc_subnets_as_array)
mysub = [ thesubnets[0], thesubnets[1] ]
or even
mysub = [ registry!(:vpc_subnets_as_array)[0], registry!(:vpc_subnets_as_array)[1] ]
Then because I don't know your use case here I'll make one up. Let's say you were using an Elastic Load Balancing Load Balancer.
dynamic!(:elastic_load_balancing_load_balancer, :elb) do
properties do
subnets mysub
end
end
You would end up with the following valid CloudFormation
"ElbElasticLoadBalancingLoadBalancer": {
"Type": "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties": {
"Subnets": [
"subnet-0xxxxxxx",
"subnet-1xxxxxxx"
]
}
}
A-