CloudFormation Rollback

I created this template, one public subnet with internet gateway
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Building A VPC From Scratch With CloudFormation",
"Resources": {
"MyVPC": {
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": "20.0.0.0/16",
"EnableDnsSupport": "true",
"EnableDnsHostnames": "true"
}
},
"PublicSubnet": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"CidrBlock": "20.0.0.0/24",
"MapPublicIpOnLaunch": "true",
"VpcId": {
"Ref": "MyVPC"
}
}
},
"InternetGateway": {
"Type": "AWS::EC2::InternetGateway"
},
"GatewayAttachment": {
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"InternetGatewayId": {
"Ref": "InternetGateway"
},
"VpcId": {
"Ref": "MyVPC"
}
}
},
"PublicRT": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "MyVPC"
}
}
},
"PublicRoute": {
"Type": "AWS::EC2::Route",
"Properties": {
"DestinationCidrBlock": "20.0.0.0/24",
"GatewayId": {
"Ref": "InternetGateway"
},
"RouteTableId": {
"Ref": "PublicRT"
}
}
},
"SubnetAssociation": {
"Type": "AWS::EC2::SubnetRouteTableAssociation",
"Properties": {
"RouteTableId": {
"Ref": "PublicRT"
},
"SubnetId": {
"Ref": "PublicSubnet"
}
}
}
}
}


I got below error,

user_274747_5b8fd2416fe1c.png_800.jpg


I unable to solve this error. Please help.

  • post-author-pic
    Tinu D
    09-05-2018

    I changed to "DestinationCidrBlock": "0.0.0.0/0" and it worked. Thanks


  • post-author-pic
    Tia W
    09-05-2018

    Great.  Glad you got it figured out.

Looking For Team Training?

Learn More