我遇到了通过 cloudformation 模板为 elasticache 创建 2 个子网的情况。
代码示例如下。
"SubnetGroup" : {
"Type" : " "SubnetIds" : [ { "Ref" : "Subnet1" }, { "Ref" : "Subnet2" } ]",
"Properties" : {
"Description" : "Cache Subnet Group",
"SubnetIds" : [ { "Ref" : "Subnet1" }, { "Ref" : "Subnet2" } ]
}
}
我了解对象的逻辑,但我不知道如何创建
"SubnetIds" : [ { "Ref" : "**Subnet1**" }, { "Ref" : "**Subnet2**" } ]
我不知道对象 aws:ec2::subnet 是否能够为对象“AWS::ElastiCache::SubnetGroup”创建子网。
*"SubnetIds" : [ { "Ref" : "**Subnet1**" }, { "Ref" : "**Subnet2**" } ]*
下面的代码可以为“AWS::ElastiCache::SubnetGroup”创建一个子网吗?:
"Subnet": {
"Type" : "AWS::EC2::Subnet",
"Properties" : {
"AvailabilityZone" : String,
"CidrBlock" : String,
"Tags" : [ EC2 Tag, ... ],
"VpcId" : { "Ref" : String }
}
}
或者是否有“AWS::ElastiCache::Subnet”来创建一个仅用于弹性缓存目的的子网,我在文档中没有找到?