{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/10137","repository_url":"https://api.github.com/repos/hashicorp/terraform","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/10137/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/10137/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/10137/events","html_url":"https://github.com/hashicorp/terraform/pull/10137","id":189453954,"number":10137,"title":"Add new aws_vpc_endpoint_route_table_association resource","user":{"login":"ewbankkit","id":2404182,"avatar_url":"https://avatars.githubusercontent.com/u/2404182?v=3","gravatar_id":"","url":"https://api.github.com/users/ewbankkit","html_url":"https://github.com/ewbankkit","followers_url":"https://api.github.com/users/ewbankkit/followers","following_url":"https://api.github.com/users/ewbankkit/following{/other_user}","gists_url":"https://api.github.com/users/ewbankkit/gists{/gist_id}","starred_url":"https://api.github.com/users/ewbankkit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewbankkit/subscriptions","organizations_url":"https://api.github.com/users/ewbankkit/orgs","repos_url":"https://api.github.com/users/ewbankkit/repos","events_url":"https://api.github.com/users/ewbankkit/events{/privacy}","received_events_url":"https://api.github.com/users/ewbankkit/received_events","type":"User","site_admin":false},"labels":[{"id":85946959,"url":"https://api.github.com/repos/hashicorp/terraform/labels/enhancement","name":"enhancement","color":"d4c5f9","default":true},{"id":323728928,"url":"https://api.github.com/repos/hashicorp/terraform/labels/new-resource","name":"new-resource","color":"d4c5f9","default":false},{"id":127939518,"url":"https://api.github.com/repos/hashicorp/terraform/labels/provider/aws","name":"provider/aws","color":"bfdadc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-11-15T17:22:02Z","updated_at":"2016-12-05T12:55:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hashicorp/terraform/pulls/10137","html_url":"https://github.com/hashicorp/terraform/pull/10137","diff_url":"https://github.com/hashicorp/terraform/pull/10137.diff","patch_url":"https://github.com/hashicorp/terraform/pull/10137.patch"},"body":"This PR follows on from #9244 and addresses #9138.\r\nHere's the log from @kwilczynski's initial commit:\r\n```\r\nThis commit adds a new resource which allows to a list of route tables to be\r\neither added and/or removed from an existing VPC Endpoint. This resource would\r\nalso be complimentary to the existing `aws_vpc_endpoint` resource where the\r\nroute tables might not be specified (not a requirement for a VPC Endpoint to\r\nbe created successfully) during creation, especially where the workflow is\r\nsuch where the route tables are not immediately known.\r\n```\r\nAs it stands now the new `aws_vpc_endpoint_route_table_association` resource associates/dissociates as single `route_table_id` with a VPC endpoint.\r\nSomehow I feel it's \"better\" Terraform to use a `count` attribute on the resource to associate multiple route tables with a VPC endpoint rather than accept a list of route tables in a single association, e.g.\r\n```\r\nresource \"aws_vpc\" \"foo\" {\r\n    cidr_block = \"10.0.0.0/16\"\r\n}\r\n\r\nresource \"aws_vpc_endpoint\" \"s3\" {\r\n    vpc_id = \"${aws_vpc.foo.id}\"\r\n    service_name = \"com.amazonaws.us-west-2.s3\"\r\n}\r\n\r\nvariable \"c\" {\r\n    default = 2\r\n}\r\n\r\nresource \"aws_route_table\" \"rt\" {\r\n    count = \"${var.c}\"\r\n\r\n    vpc_id = \"${aws_vpc.foo.id}\"\r\n\r\n    tags {\r\n        Name = \"test\"\r\n    }\r\n}\r\n\r\nresource \"aws_vpc_endpoint_route_table_association\" \"a\" {\r\n    count = \"${var.c}\"\r\n\r\n\tvpc_endpoint_id = \"${aws_vpc_endpoint.s3.id}\"\r\n\troute_table_id  = \"${element(aws_route_table.rt.*.id, count.index)}\"\r\n}\r\n```\r\nSince this is a \"synthetic\" resource (no underlying AWS resource maps exactly to this) this doesn't cause a cognitive disconnect, plus it greatly simplifies the implementation.\r\nI welcome feedback on this, especially from @coen-hyde and @supergibbs who commented on the associated issue."},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/264847166","html_url":"https://github.com/hashicorp/terraform/pull/10137#issuecomment-264847166","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/10137","id":264847166,"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-12-05T12:55:35Z","updated_at":"2016-12-05T12:55:35Z","body":"Hi @ewbankkit \r\n\r\nThanks for the work here (and the responses to my nit questions)\r\n\r\nThis LGTM!\r\n\r\n```\r\n% make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSVpcEndpointRouteTableAssociation_'                                                                                               ✹\r\n==> Checking that code complies with gofmt requirements...\r\ngo generate $(go list ./... | grep -v /terraform/vendor/)\r\n2016/12/05 12:53:35 Generated command/internal_plugin_list.go\r\nTF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSVpcEndpointRouteTableAssociation_ -timeout 120m\r\n=== RUN   TestAccAWSVpcEndpointRouteTableAssociation_basic\r\n--- PASS: TestAccAWSVpcEndpointRouteTableAssociation_basic (50.68s)\r\nPASS\r\nok  \tgithub.com/hashicorp/terraform/builtin/providers/aws\t50.700s\r\n```"}}
{"actor":{"display_login":"stack72"}}