In CloudFormation, I'm creating a VPC, two EC2 instances, and an Elasticache in front of them. In the template, I'm trying to add the elasticache to the vpc. The problem's happening in creating the AWS::Elasticache::SubnetGroup
"CacheSubnetGroup" : {
"Type" : "AWS::ElastiCache::SubnetGroup",
"Properties" : {
"Description" : "Subnets available for the ElastiCache Cluster",
"SubnetIds" : [ ... ]
}
},
I do not want to ask the user to input the subnet list as suggested here because I'm assuming the user doesn't know what a subnet is. Is there any function similar to { "Fn::GetAtt" : ["myVpc", "SubnetList"] }?
edit After jarmod's response, I'm creating the subnets, vpc, and everything else. But one problem still remains. I can launch the EC2's in the created VPC, but the instances get created and in the middle on initializing the instance shuts down and new instances are spun up. This cycle goes on until I delete the cf stack. Here's the part where I think the problem is originating:
"WebServerGroup" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"VPCZoneIdentifier" : [{ "Ref" : "InstanceSubnet1" }, { "Ref" : "InstanceSubnet2" }, { "Ref" : "InstanceSubnet3" }, { "Ref" : "InstanceSubnet4" }],
"LaunchConfigurationName" : { "Ref" : "LaunchConfig" },
"MinSize" : "1",
"MaxSize" : "4",
...
}
}