I am trying to create Network resources using CloudFormation template but when I import the template i get following error:
The following resource types are not supported for resource import: AWS::EC2::SubnetRouteTableAssociation,AWS::EC2::VPCGatewayAttachment,AWS::EC2::Route,AWS::EC2::Route
Any idea what be the reason for the same. Below the code from my CF template:
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
TestDevSubnetRouteTableAssociation:
Type: 'AWS::EC2::SubnetRouteTableAssociation'
Properties:
RouteTableId: TestDevPublicRouteTable
SubnetId: PublicSubnet
Route1:
Type: 'AWS::EC2::Route'
Properties:
DestinationCidrBlock: 172.32.0.0/16
RouteTableId: !Ref TestDevPublicRouteTable
Route2:
Type: 'AWS::EC2::Route'
Properties:
DestinationCidrBlock: 0.0.0.0/0
RouteTableId: !Ref TestDevPublicRouteTable
GatewayId: !Ref TestDevInternetGateway