Ich erstelle einen ganzen Stapel mit CloudFormation. Ich habe festgestellt, dass obwohl ich eine Routing-Regel für 0.0.0.0/0 habe, um auf ein Internet-Gateway in meiner Cloud-Formationsvorlage zuzugreifen, es nicht erstellt wird.Cloudformation: VPC-Routing-Tabelle ohne Route für Internet-Gateway
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-Tabelle:
"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"
}
}
}
Alle Elemente werden erstellt, mit Ausnahme der IG-Routing-Regel für die VPC. Es gibt keine Fehler bei der Erstellung des Cloud-Formatierungsstapels.
Die Routing-Tabelle:
Destination: 172.31.0.0/16
Target: local
Erwartete Routing-Tabelle:
Destination: 172.31.0.0/16
Target: local
Destination: 0.0.0.0/0
Target: igw-********
Bitte beachte, dass ich die Regel von mir direkt nach der Cloudformation Stapel Erstellung hinzufügen kann.
Gibt es etwas, das mir fehlt?
Die Ressourcen aussehen richtig, die volle Leistung Ihres Stacks Event History me- fügen Sie bitte ([ 'Events'] (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn- console-view-stack-data-resources.html) in der Konsole) für den Fall, dass dort etwas Ungewöhnliches ist. – wjordan
Ich denke, es ist ein bisschen unsicher, die gesamte Ausgabe meines Stapels zu teilen. Ich habe nur überprüft, und es gibt keine Fehler oder Warnungen, alle haben den Status CREATE_COMPLETE. Zuerst wird "ig" erstellt, dann "vpc", dann "rtb" und "gw1" und zuletzt "route1". Ich denke, es ist ein Fehler. – zed