mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #4500 from hashicorp/b-route-table-nat-gateway
provider/aws: Don't set NatGatewayId with no value
This commit is contained in:
commit
7326633060
@ -290,12 +290,15 @@ func resourceAwsRouteTableUpdate(d *schema.ResourceData, meta interface{}) error
|
|||||||
RouteTableId: aws.String(d.Id()),
|
RouteTableId: aws.String(d.Id()),
|
||||||
DestinationCidrBlock: aws.String(m["cidr_block"].(string)),
|
DestinationCidrBlock: aws.String(m["cidr_block"].(string)),
|
||||||
GatewayId: aws.String(m["gateway_id"].(string)),
|
GatewayId: aws.String(m["gateway_id"].(string)),
|
||||||
NatGatewayId: aws.String(m["nat_gateway_id"].(string)),
|
|
||||||
InstanceId: aws.String(m["instance_id"].(string)),
|
InstanceId: aws.String(m["instance_id"].(string)),
|
||||||
VpcPeeringConnectionId: aws.String(m["vpc_peering_connection_id"].(string)),
|
VpcPeeringConnectionId: aws.String(m["vpc_peering_connection_id"].(string)),
|
||||||
NetworkInterfaceId: aws.String(m["network_interface_id"].(string)),
|
NetworkInterfaceId: aws.String(m["network_interface_id"].(string)),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if m["nat_gateway_id"].(string) != "" {
|
||||||
|
opts.NatGatewayId = aws.String(m["nat_gateway_id"].(string))
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("[INFO] Creating route for %s: %#v", d.Id(), opts)
|
log.Printf("[INFO] Creating route for %s: %#v", d.Id(), opts)
|
||||||
if _, err := conn.CreateRoute(&opts); err != nil {
|
if _, err := conn.CreateRoute(&opts); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user