I have created a stack using CloudFormation. Even I have a routing rule for 0.0.0.0/0 to access an internet gateway in cloud formation, it is not being created.
VPC:
"vpc": {
"Type": "AWS::EC2::VPC",
"Properties": {
"CidrBlock": "172.31.0.0/16",
"InstanceTenancy": "default",
"EnableDnsSupport": "true",
"EnableDnsHostnames": "true",
"Tags": [
{
"Key": "Environment",
"Value": {
"Ref": "Env"
}
}
]
}
Routing Table:
"rtb": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "vpc"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "65297cdc-8bcd-482d-af40-b0fef849b8c2"
}
}
}
VPCGatewayAttachment:
"gw1": {
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"VpcId": {
"Ref": "vpc"
},
"InternetGatewayId": {
"Ref": "ig"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "aa69d6c0-3b11-43be-a8c1-7e79176f8c89"
}
}
}
Route:
"route1": {
"Type": "AWS::EC2::Route",
"Properties": {
"DestinationCidrBlock": "0.0.0.0/0",
"RouteTableId": {
"Ref": "rtb"
},
"GatewayId": {
"Ref": "ig"
}
},
"DependsOn": "gw1",
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "a68dd12e-3c14-4fa9-ba36-e0046374a0e9"
}
}
}
Internet Gateway:
"ig": {
"Type": "AWS::EC2::InternetGateway",
"Properties": {},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "9f9b4ce3-b994-43ff-9155-04aeb7ab2edf"
}
}
}
There are no errors in the stack creation but the IG routing rule is not created.
Where I'm missing?