{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/8035","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/8035/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/8035/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/8035/events","html_url":"https://github.com/hashicorp/terraform/issues/8035","id":169814107,"number":8035,"title":"aws_route_table always triggers modify","user":{"login":"dene14","id":7289205,"avatar_url":"https://avatars.githubusercontent.com/u/7289205?v=3","gravatar_id":"","url":"https://api.github.com/users/dene14","html_url":"https://github.com/dene14","followers_url":"https://api.github.com/users/dene14/followers","following_url":"https://api.github.com/users/dene14/following{/other_user}","gists_url":"https://api.github.com/users/dene14/gists{/gist_id}","starred_url":"https://api.github.com/users/dene14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dene14/subscriptions","organizations_url":"https://api.github.com/users/dene14/orgs","repos_url":"https://api.github.com/users/dene14/repos","events_url":"https://api.github.com/users/dene14/events{/privacy}","received_events_url":"https://api.github.com/users/dene14/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/bug","name":"bug","color":"f7c6c7"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/aws","name":"provider/aws","color":"bfdadc"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-07T20:18:40Z","updated_at":"2016-08-09T03:54:20Z","closed_at":"2016-08-07T21:14:22Z","body":"Hello there!\r\n\r\n```\r\nresource \"aws_route_table\" \"private_1\" {\r\n    vpc_id = \"${var.vpc_id}\"\r\n    route {\r\n        cidr_block = \"0.0.0.0/0\"\r\n        gateway_id = \"${aws_nat_gateway.gw_1.id}\"\r\n    }\r\n\r\n    tags {\r\n        Name = \"uat_platform_private_1\"\r\n    }\r\n}\r\n```\r\nAlways triggers terraform to modify a resource:\r\n```\r\naws_route_table.private_1: Modifying...\r\n  route.1498634145.cidr_block:                \"\" => \"0.0.0.0/0\"\r\n  route.1498634145.gateway_id:                \"\" => \"nat-0509bae43356cedc1\"\r\n  route.1498634145.instance_id:               \"\" => \"\"\r\n  route.1498634145.nat_gateway_id:            \"\" => \"\"\r\n  route.1498634145.network_interface_id:      \"\" => \"\"\r\n  route.1498634145.vpc_peering_connection_id: \"\" => \"\"\r\n  route.1584724321.cidr_block:                \"0.0.0.0/0\" => \"\"\r\n  route.1584724321.gateway_id:                \"\" => \"\"\r\n  route.1584724321.instance_id:               \"\" => \"\"\r\n  route.1584724321.nat_gateway_id:            \"nat-0509bae43356cedc1\" => \"\"\r\n  route.1584724321.network_interface_id:      \"\" => \"\"\r\n  route.1584724321.vpc_peering_connection_id: \"\" => \"\"\r\n```\r\n\r\nIt doesn't happen to public subnet routes, however it has `internat gateway` attached instead  of `NAT gateway`."},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/238446699","html_url":"https://github.com/hashicorp/terraform/issues/8035#issuecomment-238446699","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/8035","id":238446699,"user":{"login":"stack72","id":227823,"avatar_url":"https://avatars.githubusercontent.com/u/227823?v=3","gravatar_id":"","url":"https://api.github.com/users/stack72","html_url":"https://github.com/stack72","followers_url":"https://api.github.com/users/stack72/followers","following_url":"https://api.github.com/users/stack72/following{/other_user}","gists_url":"https://api.github.com/users/stack72/gists{/gist_id}","starred_url":"https://api.github.com/users/stack72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stack72/subscriptions","organizations_url":"https://api.github.com/users/stack72/orgs","repos_url":"https://api.github.com/users/stack72/repos","events_url":"https://api.github.com/users/stack72/events{/privacy}","received_events_url":"https://api.github.com/users/stack72/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T03:54:20Z","updated_at":"2016-08-09T03:54:20Z","body":"Hi @dene14 \r\n\r\nthe AWS API actually treats each of these differently:\r\n\r\n```\r\nopts := ec2.CreateRouteInput{\r\n\t\t\t\tRouteTableId:           aws.String(d.Id()),\r\n\t\t\t\tDestinationCidrBlock:   aws.String(m[\"cidr_block\"].(string)),\r\n\t\t\t\tGatewayId:              aws.String(m[\"gateway_id\"].(string)),\r\n\t\t\t\tInstanceId:             aws.String(m[\"instance_id\"].(string)),\r\n\t\t\t\tVpcPeeringConnectionId: aws.String(m[\"vpc_peering_connection_id\"].(string)),\r\n\t\t\t\tNetworkInterfaceId:     aws.String(m[\"network_interface_id\"].(string)),\r\n\t\t\t}\r\n\r\n\t\t\tif m[\"nat_gateway_id\"].(string) != \"\" {\r\n\t\t\t\topts.NatGatewayId = aws.String(m[\"nat_gateway_id\"].(string))\r\n\t\t\t}\r\n```\r\n\r\nSo we need to be clear that when some means a nat_gateway, that is what we pass to the API. We thought about trying something like checking for string prefixes but that would have broken potential naming changes from AWS\r\n\r\nP."}}
{"actor":{"display_login":"stack72"}}