【发布时间】:2021-12-05 16:43:59
【问题描述】:
我正在绑定这个 cloudformation 堆栈,但是当创建到达 DBSubnetGroup 时它失败并显示消息:属性 SubnetIds 的值必须是字符串列表类型。我感谢您的帮助。 除了 DBSubnetGroup 之外,一切似乎都运行良好。
AWSTemplateFormatVersion: 2010-09-09
Description: My First CloudFormation Template
Resources:
MyVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.1.0.0/16
EnableDnsHostnames: true
EnableDnsSupport: true
InstanceTenancy: default
Tags:
- Key: Name
Value: VPC for Activity Number 1
MySubnet:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref MyVPC
CidrBlock: 10.1.1.0/24
MapPublicIpOnLaunch: true
AvailabilityZone: "us-east-1c"
Tags:
- Key: Name
Value: Public Subnet
MySubnetA:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref MyVPC
CidrBlock: 10.1.2.0/24
MapPublicIpOnLaunch: true
AvailabilityZone: "us-east-1a"
Tags:
- Key: Name
Value: Public Subnet A
MySubnetB:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref MyVPC
CidrBlock: 10.1.3.0/24
MapPublicIpOnLaunch: true
AvailabilityZone: "us-east-1b"
Tags:
- Key: Name
Value: Public Subnet B
这就是创建失败开始的地方:
DBSubnetGroup:
Type: AWS::RDS::DBSubnetGroup
DependsOn:
- MyVPC
- MySubnet
- MySubnetA
- MySubnetB
Properties:
DBSubnetGroupDescription: Subnets to lauch the database
SubnetIds:
-!Ref MySubnet
-!Ref MySubnetA
-!Ref MySubnetB
【问题讨论】:
标签: string amazon-web-services yaml amazon-cloudformation amazon-rds