Box*_*oxy 4 aws-cloudformation
我正在尝试创建 CloudFormation Stack,它将创建 VPC、子网、IGW、路由表、NAT 网关、将子网与 RT 关联等
我的堆栈失败,NAT 网关尝试为私有路由表创建规则,以便为 NAT GW 创建路由规则。
# Punblic Elastic IP for NAT Gateway in Zone 2A
eipSubnetA:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
# NAT Gateway in Public Subnet 2A
natSubnetA:
Type: AWS::EC2::NatGateway
Properties:
AllocationId:
Fn::GetAtt: [eipSubnetA, AllocationId]
SubnetId:
Ref: PRODSubnetPublic2a
Tags:
- Key: Name
Value: nat-Subnet-a
# Route through NAT Gateway
NATRoute:
Type: AWS::EC2::Route
Properties:
RouteTableId:
Ref: PRODRTPrivate
DestinationCidrBlock: 0.0.0.0/0
GatewayId:
Ref: natSubnetA
Run Code Online (Sandbox Code Playgroud)
我在 CloudFormation Events 选项卡中看到的错误是:
The following resource(s) failed to create: [NATRoute]. . Rollback requested by user
Route did not stabilize in expected time
Run Code Online (Sandbox Code Playgroud)
不确定我错过了什么?
# Private Subnets to Route Table Association
PrivateSubnetA:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId:
Ref: PRODSubnetPrivate2a
RouteTableId:
Ref: PRODRTPrivate
PrivateSubnetB:
Type: AWS::EC2::SubnetRouteTableAssociation
Properties:
SubnetId:
Ref: PRODSubnetPrivate2b
RouteTableId:
Ref: PRODRTPrivate
# Punblic Elastic IP for NAT Gateway in Zone 2A
eipSubnetA:
Type: AWS::EC2::EIP
Properties:
Domain: vpc
# NAT Gateway in Public Subnet 2A
natSubnetA:
Type: AWS::EC2::NatGateway
Properties:
AllocationId:
Fn::GetAtt: [eipSubnetA, AllocationId]
SubnetId:
Ref: PRODSubnetPublic2a
Tags:
- Key: Name
Value: nat-Subnet-a
# Route through NAT Gateway
NATRoute:
Type: AWS::EC2::Route
Properties:
RouteTableId:
Ref: PRODRTPrivate
DestinationCidrBlock: 0.0.0.0/0
GatewayId:
Ref: natSubnetA
Run Code Online (Sandbox Code Playgroud)
我预计私有路由表应该有目的地 0.0.0.0/0 的路由 NATGateway
| 归档时间: |
|
| 查看次数: |
2142 次 |
| 最近记录: |