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

feat: Add enable_public_igw_route flag to optionally create public route tables to internet gateway #1122

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pjaudiomv
Copy link
Contributor

@pjaudiomv pjaudiomv commented Sep 27, 2024

Description

Add enable_public_igw_route flag to optionally create public route tables to internet gateway

Motivation and Context

It can be desirable to have both an internet gateway and want to alter the default routes for public subnets through either using vpc endpoints (gwlb) or transit gateways. Offering this simple flag offers flexibility and enables someone to output the public route table ids and add any routes they want, rather than prescribing to specific use cases.

This cant be inside the VPC module because the endpoints are created outside of it and use the private subnets so it would create a circular dependency. By adding enable_public_igw_route flag. it allows someone to alter these routes if wanted.

Example (pseudo)

resource "aws_route" "public_vpce_route" {
  for_each                       = aws_vpc_endpoint.gwlb
  route_table_id              = local.public_rtbl_to_subnet_id_map[each.key]
  destination_cidr_block = "0.0.0.0/0"
  vpc_endpoint_id           = each.value.id
}

Breaking Changes

This is fully backwards compatible and does not introduce any breaking changes.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Copy link

This PR has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this PR will be closed in 10 days

@github-actions github-actions bot added the stale label Oct 29, 2024
@github-actions github-actions bot removed the stale label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant