无法使用云形成创建 VPC 和路由 table
Unable to create VPC and routing table using cloud formation
我是云形成的新手。我尝试使用云创建vpc,子网及其路由table formation.But无法创建it.Anyone请帮我解决issue.My yaml文件如下:
myvpc:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsSupport: true
EnableDnsHostnames: true
InstanceTenancy: default
Tags:
- Name: gccvpc
myinternetgateway:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Name: gccgt
mygatewayattach:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
InternetGatewayId: !Ref myinternetgateway
VpcId: !Ref myvpc
mysubnet1:
Type: AWS::EC2::Subnet
Properties:
AvailabilityZone: us-east-1a
VpcId: !Ref myvpc
CidrBlock: 10.0.1.0/24
MapPublicIpOnLaunch: true
Routetable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref myvpc
Route:
Type: AWS::EC2::Route
DependsOn: myinternetgateway
Properties:
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref myinternetgateway
RouteTableId: !Ref Routetable
SubnetARouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref Routetable
SubnetId: !Ref mysubnet1
您缺少资源条件并且您的标记属性不正确。下次请 post 错误,您可以在 CloudFormation 控制台的事件选项卡上找到它。
Resources:
myvpc:
Type: "AWS::EC2::VPC"
Properties:
CidrBlock: "10.0.0.0/16"
EnableDnsSupport: "true"
EnableDnsHostnames: "true"
InstanceTenancy: "default"
Tags:
- Key: "Name"
Value: "gccvpc"
myinternetgateway:
Type: "AWS::EC2::InternetGateway"
Properties:
Tags:
- Key: "Name"
Value: "gccvpc"
mygatewayattach:
Type: "AWS::EC2::VPCGatewayAttachment"
Properties:
InternetGatewayId: !Ref "myinternetgateway"
VpcId: !Ref "myvpc"
mysubnet1:
Type: "AWS::EC2::Subnet"
Properties:
AvailabilityZone: "us-east-1a"
VpcId: !Ref "myvpc"
CidrBlock: "10.0.1.0/24"
MapPublicIpOnLaunch: "true"
Routetable:
Type: "AWS::EC2::RouteTable"
Properties:
VpcId: !Ref "myvpc"
Route:
Type: "AWS::EC2::Route"
DependsOn: "myinternetgateway"
Properties:
DestinationCidrBlock: "0.0.0.0/0"
GatewayId: !Ref "myinternetgateway"
RouteTableId: !Ref "Routetable"
SubnetARouteTableAssociation:
Type: "AWS::EC2::SubnetRouteTableAssociation"
Properties:
RouteTableId: !Ref "Routetable"
SubnetId: !Ref "mysubnet1"
我是云形成的新手。我尝试使用云创建vpc,子网及其路由table formation.But无法创建it.Anyone请帮我解决issue.My yaml文件如下:
myvpc:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsSupport: true
EnableDnsHostnames: true
InstanceTenancy: default
Tags:
- Name: gccvpc
myinternetgateway:
Type: AWS::EC2::InternetGateway
Properties:
Tags:
- Name: gccgt
mygatewayattach:
Type: AWS::EC2::VPCGatewayAttachment
Properties:
InternetGatewayId: !Ref myinternetgateway
VpcId: !Ref myvpc
mysubnet1:
Type: AWS::EC2::Subnet
Properties:
AvailabilityZone: us-east-1a
VpcId: !Ref myvpc
CidrBlock: 10.0.1.0/24
MapPublicIpOnLaunch: true
Routetable:
Type: AWS::EC2::RouteTable
Properties:
VpcId: !Ref myvpc
Route:
Type: AWS::EC2::Route
DependsOn: myinternetgateway
Properties:
DestinationCidrBlock: 0.0.0.0/0
GatewayId: !Ref myinternetgateway
RouteTableId: !Ref Routetable
SubnetARouteTableAssociation:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
RouteTableId: !Ref Routetable
SubnetId: !Ref mysubnet1
您缺少资源条件并且您的标记属性不正确。下次请 post 错误,您可以在 CloudFormation 控制台的事件选项卡上找到它。
Resources:
myvpc:
Type: "AWS::EC2::VPC"
Properties:
CidrBlock: "10.0.0.0/16"
EnableDnsSupport: "true"
EnableDnsHostnames: "true"
InstanceTenancy: "default"
Tags:
- Key: "Name"
Value: "gccvpc"
myinternetgateway:
Type: "AWS::EC2::InternetGateway"
Properties:
Tags:
- Key: "Name"
Value: "gccvpc"
mygatewayattach:
Type: "AWS::EC2::VPCGatewayAttachment"
Properties:
InternetGatewayId: !Ref "myinternetgateway"
VpcId: !Ref "myvpc"
mysubnet1:
Type: "AWS::EC2::Subnet"
Properties:
AvailabilityZone: "us-east-1a"
VpcId: !Ref "myvpc"
CidrBlock: "10.0.1.0/24"
MapPublicIpOnLaunch: "true"
Routetable:
Type: "AWS::EC2::RouteTable"
Properties:
VpcId: !Ref "myvpc"
Route:
Type: "AWS::EC2::Route"
DependsOn: "myinternetgateway"
Properties:
DestinationCidrBlock: "0.0.0.0/0"
GatewayId: !Ref "myinternetgateway"
RouteTableId: !Ref "Routetable"
SubnetARouteTableAssociation:
Type: "AWS::EC2::SubnetRouteTableAssociation"
Properties:
RouteTableId: !Ref "Routetable"
SubnetId: !Ref "mysubnet1"