-
Notifications
You must be signed in to change notification settings - Fork 0
Allow the use of an instance id in the route creation in ec2_vpc (for NAT private networks) #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Conversation
) there is a need to use named parameters in the method call to differentiate between a gateway ID and an instance ID when trying to create a route Otherwise upon trying to register a route with an existing instance ID instead of the gateway ID one gets an error like follows: failed: [127.0.0.1] => {"failed": true, "item": ""} msg: Unable to create and associate route table {u'routes': [{u'dest': u'0.0.0.0/0', u'gw': u'i-09d47501'}], u'subnets': [u'10.1.10.0/24', u'10.1.12.0/24', u'10.1.20.0/24']}, error: EC2ResponseError: 400 Bad Request <?xml version="1.0" encoding="UTF-8"?> <Response><Errors><Error><Code>InvalidGatewayID.NotFound</Code><Message>The gateway ID 'i-09d47501' does not exist</Message></Error></Errors><RequestID>fa95104e-37ab-44ee-b8fd-2c5033179585</RequestID></Response>
|
@romanrev, I have situation, where I want to add some routes against my nat instance id inside the routing table, can you please guide me that how I can do that? as I want to first create the nat instance then want to get it's id and add the route against it. I have done this: Thanks in advance |
|
Hi @arbabnazar. Please refer to the following gist - an excerpt from my VPC setup playbook. The sequence of all required actions is marked in the nat_setup.yml by comments STEP 1-4, everything else in that playbook is just for reference so that all the used data structures are clear. I have also provided the templates and extracts from group_vars/all file for the same purpose. I hope you get the idea, if not - let me know and I can explain it further. In a nutshell, all I do is:
The NAT instances also run a |
|
Hey @arbabnazar: in the task lists that you posted I could not see where you construct the NAT route table and where you merge it with the the existing route table defined in vpc.yml? After that is done, you will ned to call |
|
Hi @romanrev , truth to be told, I am confused about constructing the NAT route table, can you please give me hint, as I can see your NAT route table construction but unfortunately, some tags are really confusing me, that the area, where I need your help. Thanks |
|
|
@romanrev sorry for the late reply, I am able to work it. Thanks for your help. |
According to boto.vpc.VPCCOnnection.create_route there is a need to use named parameters in the method call to differentiate between a gateway ID and an instance ID when trying to create a route.
Otherwise upon trying to register a route with an existing (NAT) instance ID instead of the gateway ID one gets an error like follows: