Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: Need a feature to work with vpc_endpoint_id and destination_prefix_list_id to create AWS routes #39916

Open
nick-terra opened this issue Oct 28, 2024 · 2 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/vpc Issues and PRs that pertain to the vpc service.

Comments

@nick-terra
Copy link

nick-terra commented Oct 28, 2024

Description

I am trying to create AWS routes using aws_route block. My use-case is to create route(s) for multiple cidr blocks which will serve cross-AZ network establishment. My approach is to create a prefix list. Then pass the prefix list to the routes block under destination_prefix_list_id argument. However, I get stuck due to conflict between destination_prefix_list_id and vpc_endpoint_id arguments. I am aware of the underlying AWS API error for my use-case since my VPCE is of Gateway Load Balancer type. I need to have a work around for my use-case to avoid long list of route blocks in my code and have an iterative approach where I run my loop across a list of route table IDs and attach the prefix list IDs. I am using aws_vpc_endpoint_route_table_association referring to a previous blog (#18607). But the VPCE type is another blocker for me in that case.

AWS Provider: 5.50.0
Terraform Version: 1.8.3

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

aws_route
aws_vpc_endpoint_route_table_association
aws_ec2_managed_prefix_list

Potential Terraform Configuration

resource "aws_route" "core_routes" {
  for_each = {
    for loop applied with necessary filters
  }
  route_table_id             = aws_route_table.private_route_table[loop keys/values].id
  destination_prefix_list_id = var.prefix_list_id
}

resource "aws_vpc_endpoint_route_table_association" "core_routes_to_vpce" {
  depends_on = [aws_route.core_routes]
  for_each = {
    for loop applied with necessary filters
  }
  route_table_id  = aws_route_table.private_route_table[loop keys/values].id
  vpc_endpoint_id = local.swapped_fw_endpoints[loop keys/values].id
}

References

#18607
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint_route_table_association
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route

Would you like to implement a fix?

Yes

@nick-terra nick-terra added the enhancement Requests to existing resources that expand the functionality or scope. label Oct 28, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added service/vpc Issues and PRs that pertain to the vpc service. needs-triage Waiting for first response or review from a maintainer. labels Oct 28, 2024
@nick-terra
Copy link
Author

@ewbankkit Is there any fix or a workaround or an enhancement I can expect to work with for this use-case?

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/vpc Issues and PRs that pertain to the vpc service.
Projects
None yet
Development

No branches or pull requests

2 participants