hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.71k stars 9.07k forks source link

[Enhancement]: Add 'Egress_Only_Internet_Gateway_ID' to 'aws_route_table_associationa' Resource #37005

Closed bwright86 closed 1 month ago

bwright86 commented 4 months ago

Description

It appears the Route Table Association resource isn't able to accept Egress-Only Internet Gateway ID's. This is an issue if the EIGW is created after the VPC/Route Tables are created. It would be helpful to be able to add an EIGW to an existing Route Table.

Affected Resource(s) and/or Data Source(s)

'aws_route_table_association' Resource

Potential Terraform Configuration

resource "aws_egress_only_internet_gateway" "example" {
  vpc_id = data.terraform_remote_state.vpc.outputs.id
}

resource "aws_route_table_association" "example" {
  for_each = toset(data.terraform_remote_state.vpc.outputs.route_table_ids)

  egress_gateway_id = aws_egress_only_internet_gateway.example.id
  route_table_id = each.value
}

References

No response

Would you like to implement a fix?

No

github-actions[bot] commented 4 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

acwwat commented 4 months ago

I could be wrong, but I don't think you can associate a route table to an EIGW (via edge association). This is by design because there is no traffic going in from the internet to the EIGW. I checked the AWS Management Console and it is not doable.

The only thing you can do is to create routes to the EIGW in a route table that gets associated with a subnet. In Terraform that is done with the egress_only_gateway_id argument of the aws_route resource.

bwright86 commented 4 months ago

Thanks for the input on this. You might be correct, and using the aws_route resource would allow associating an EIGW after the route table is created. Let me confirm this on Monday, and I’ll close this issue.

Also, I noticed thru the console that there are other options to add resources into a route table, it seems aws_route resource handles those as well. So this may fill in my knowledge gap on this :-)

justinretzolk commented 1 month ago

Since we haven't heard back, I think it's a safe assumption that Anthony's comment did the trick 🙂. With that in mind, I'm going to go ahead and close this issue.

github-actions[bot] commented 1 month ago

[!WARNING] This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

github-actions[bot] commented 1 week ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.