我试图find一种方法来设置Cluster.template JSON文件中的默认VPC,子网和安全组。
有没有办法通过内置的“Ref”将现有的VPC(或Subnet / Security组)作为parameter passing给模板?
这显然没有工作:
"Parameters": { "VpcId": { "Type": "AWS::EC2::VPC::Id", "Default": { "Ref" : "vpc-123456789" }, .... }
"Parameters": { "VpcId": { "Type": "AWS::EC2::VPC::Id", "Default": "vpc-123456789" , } }
然后通过使用Ref函数来使用该vpc-id
"Resources" :{ "DbSubnet1" : { "Type" : "AWS::EC2::Subnet", "Properties" : { "AvailabilityZone" : "us-east-1c" "VpcId" : { "Ref" : "VpcId" }, "CidrBlock" : "10.0.1.0/24" } } }