I came across of creating 2 subnet for elasticache to use via cloudformation template.
The code example is below.
"SubnetGroup" : {
"Type" : " "SubnetIds" : [ { "Ref" : "Subnet1" }, { "Ref" : "Subnet2" } ]",
"Properties" : {
"Description" : "Cache Subnet Group",
"SubnetIds" : [ { "Ref" : "Subnet1" }, { "Ref" : "Subnet2" } ]
}
}
I understand the logic of the object but what i don't know how to create is the
"SubnetIds" : [ { "Ref" : "**Subnet1**" }, { "Ref" : "**Subnet2**" } ]
I dont know if the object aws:ec2::subnet is capable of creating a subnet for object "AWS::ElastiCache::SubnetGroup".
*"SubnetIds" : [ { "Ref" : "**Subnet1**" }, { "Ref" : "**Subnet2**" } ]*
Can the code below create a subnet for "AWS::ElastiCache::SubnetGroup"?:
"Subnet": {
"Type" : "AWS::EC2::Subnet",
"Properties" : {
"AvailabilityZone" : String,
"CidrBlock" : String,
"Tags" : [ EC2 Tag, ... ],
"VpcId" : { "Ref" : String }
}
}
Or is there "AWS::ElastiCache::Subnet" to create a subnet for elasticache purpose only which I don't find in the docs?