providers/aws: fix issue where default route was being added
This commit is contained in:
parent
c615afc097
commit
f085ae65fa
|
@ -110,12 +110,18 @@ func resource_aws_route_table_update(
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append to the routes what we've done so far
|
// If we didn't delete the route, append it to the list of routes
|
||||||
resultRoutes = append(resultRoutes, map[string]string{
|
// we have.
|
||||||
"cidr_block": op.Route.DestinationCidrBlock,
|
if op.Op != routeTableOpDelete {
|
||||||
"gateway_id": op.Route.GatewayId,
|
resultMap := map[string]string{"cidr_block": op.Route.DestinationCidrBlock}
|
||||||
"instance_id": op.Route.InstanceId,
|
if op.Route.GatewayId != "" {
|
||||||
})
|
resultMap["gateway_id"] = op.Route.GatewayId
|
||||||
|
} else if op.Route.InstanceId != "" {
|
||||||
|
resultMap["instance_id"] = op.Route.InstanceId
|
||||||
|
}
|
||||||
|
|
||||||
|
resultRoutes = append(resultRoutes, resultMap)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update our state with the settings
|
// Update our state with the settings
|
||||||
|
|
Loading…
Reference in New Issue