В вашем шаблоне несколько ошибок .
Самое главное, что вам не нужен Route1
с локальным правилом 172.32.0.0/16
. Он всегда создается по умолчанию.
Также TestDevSubnetRouteTableAssociation
отсутствует !Ref
в его параметрах.
Я изменил ваш шаблон, так что теперь развертывается . Я не проверял его функциональность, только то, развертывается ли он.
Можно использовать как основу для будущих модификаций. :
AWSTemplateFormatVersion: 2010-09-09
Resources:
TestDevVPC:
Type: 'AWS::EC2::VPC'
Properties:
CidrBlock: 172.32.0.0/16
Tags:
- Key: Description
Value: Created for Test development
PublicSubnet:
Type: 'AWS::EC2::Subnet'
Properties:
CidrBlock: 172.32.1.0/24
MapPublicIpOnLaunch: true
VpcId: !Ref TestDevVPC
Tags:
- Key: Description
Value: Public subnet for Test build
TestDevPublicRouteTable:
Type: 'AWS::EC2::RouteTable'
Properties:
VpcId: !Ref TestDevVPC
Tags:
- Key: Description
Value: public route table
TestDevInternetGateway:
Type: 'AWS::EC2::InternetGateway'
Properties:
Tags:
- Key: Description
Value: Internet Gateway for Test Dev
TestDevIGVPCAttach:
Type: 'AWS::EC2::VPCGatewayAttachment'
Properties:
InternetGatewayId: !Ref TestDevInternetGateway
VpcId: !Ref TestDevVPC
Route2:
Type: 'AWS::EC2::Route'
Properties:
DestinationCidrBlock: 0.0.0.0/0
RouteTableId: !Ref TestDevPublicRouteTable
GatewayId: !Ref TestDevInternetGateway
TestDevSubnetRouteTableAssociation:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
RouteTableId: !Ref TestDevPublicRouteTable
SubnetId: !Ref PublicSubnet