Merge branch 'issue_7368' into devel
This commit is contained in:
commit
38c29e1fff
1 changed files with 6 additions and 4 deletions
|
@ -414,15 +414,17 @@ def create_vpc(module, vpc_conn):
|
||||||
try:
|
try:
|
||||||
new_rt = vpc_conn.create_route_table(vpc.id)
|
new_rt = vpc_conn.create_route_table(vpc.id)
|
||||||
for route in rt['routes']:
|
for route in rt['routes']:
|
||||||
r_gateway = route['gw']
|
route_kwargs = {}
|
||||||
if r_gateway == 'igw':
|
if route['gw'] == 'igw':
|
||||||
if not internet_gateway:
|
if not internet_gateway:
|
||||||
module.fail_json(
|
module.fail_json(
|
||||||
msg='You asked for an Internet Gateway ' \
|
msg='You asked for an Internet Gateway ' \
|
||||||
'(igw) route, but you have no Internet Gateway'
|
'(igw) route, but you have no Internet Gateway'
|
||||||
)
|
)
|
||||||
r_gateway = igw.id
|
route_kwargs['gateway_id'] = igw.id
|
||||||
vpc_conn.create_route(new_rt.id, route['dest'], r_gateway)
|
else:
|
||||||
|
route_kwargs['instance_id'] = route['gw']
|
||||||
|
vpc_conn.create_route(new_rt.id, route['dest'], **route_kwargs)
|
||||||
|
|
||||||
# Associate with subnets
|
# Associate with subnets
|
||||||
for sn in rt['subnets']:
|
for sn in rt['subnets']:
|
||||||
|
|
Loading…
Add table
Reference in a new issue