- Newest
- Most votes
- Most comments
Hi, you are right. Yes, an additional validation could probably be done by CFN when launching this stack to make sure that the id of the proper kind of object is provided
But, re:Post is not the right place for such bug report / feature report: it is usually not monitored by service teams like the one for CFN. So, you should open a Support case via the console of your AWS account to have this case worked on.
Best,
Didier
AWS::EC2::Route is used to specify a route in a route table.
With this, you can have local gateway, internet gateway, NAT gateway, virtual private gateway added to route. I understand you wanted to create PrivateSubnetRoute, so you will need to have NATFatewayId specified there but cloudformation doesn't know by your resource name that you want to create private subnet.
Cloudfromation tried to add route for Internet Gateway with NATGW id, which failed after a while as GatewayId is used to specify Internetgateway.
Please refer AWS::EC2::Route.
Hope this explanation helps.
Comment here if you have additional questions, happy to help.
Abhishek
Do you have any further questions, happy to assist if you have any.
Thank you for the answer secondabhi_aws, but I was not asking how to declare a private network. I was trying to report the CloudFormation behavior that I perceive as a bug. Sorry for not specifying that more clearly.
I'm OK with the fact that CloudFormation refused to create a route for an internet gateway with the id of a NAT gateway, it's exactly what it's supposed to do in this situation. What is not OK is that CloudFormation did not fail right away with an error like this: "The id that you've put into GatewayId field is not actually an internet gateway, try something else".
The error that CloudFormation reports now does not help with troubleshooting. It does not even say that the problem is with AWS::EC2::Route resource. And hanging for 20 minutes before finally failing does not speed up troubleshooting either.
I understand your point at first place but since GatewayId is one of the acceptable properties for AWS:EC2:Route, so when you tried to create the stack with the template, it was trying to create the IGW with Natgateway id and that would happen during runtime which is why it took time to reflect and finally errored out. All the syntactic and semantic error are spontaneous to appear but this type of situation(not specific this one, but there are so many other situations as well) takes time where things are not correct logically.
What I see here is an example of missing input validation. When I put the id of a totally different resource into GatewayId, e.g. "GatewayId: !Ref PublicSubnet" then CloudFormation does not wait for 20 minutes. It fails after one second with a message like this: "The gateway ID 'subnet-12345678' does not exist". It looks like CloudFormation (or whatever AWS API it calls behind the scene) only checks that the id that was put into GatewayId belongs to a gateway. It does not check the type of the gateway though.
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 months ago
Didier, thank you or the answer. Sure, I'll try to create a support ticket from the AWS Management Console. I posted here only because I was not sure where I should submit a bug report, and this piece of advice (https://repost.aws/questions/QUtZd267f4SSuyBkfNxQY1Cw/bug-report) was what Google suggested.
Just in case someone reads this question: you cannot create support tickets if you are on Basic (free) support plan.