Infrastructure as CodeUsing Terraform Data Sources Effectively
Learn how to use Terraform data sources to query existing resources, look up AMIs, reference remote state, and build dynamic configurations. Complete.
Infrastructure as Code
terraform-aws-modules/terraform-aws-vpc v6.8.0 adds a toggle to disable the default route on public route tables (#1188). Upgrade notes inside.
terraform-aws-modules/terraform-aws-vpc v6.8.0 is out, bumping from v6.7.3 (the changelog diff is actually generated against v6.7.4). This is a minor feature release with a single notable change: a new toggle to disable the automatic creation of the default route on public route tables. This matters for teams managing custom egress paths (e.g., centralized egress via Transit Gateway, firewall appliances, or NAT alternatives) who previously had to work around the module's hardcoded 0.0.0.0/0 route to the Internet Gateway.
Added via #1188, commit 4ca30c3. Previously, whenever the module created an Internet Gateway (create_igw = true), it unconditionally added a default route (0.0.0.0/0 -> igw-xxxx) to every public route table. This new release introduces a variable that lets you disable that default route creation while still letting the module manage the public route tables and subnet associations.
The release notes are thin — they describe the feature title and link the PR/commit but don't enumerate the exact variable name, default value, or whether it applies per-subnet-group or globally. Before wiring this into production, confirm the exact attribute name by checking variables.tf in the tagged release or the PR diff itself:
# Inspect the exact variable introduced in this release
git clone --depth 1 --branch v6.8.0 https://github.com/terraform-aws-modules/terraform-aws-vpc.git
grep -n -i "default_route" terraform-aws-vpc/variables.tfOnce confirmed, a typical use case — disabling the public default route because egress is routed through a custom appliance or TGW — would look like this (replace the variable name with whatever grep above returns if it differs):
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 6.8.0"
name = "custom-egress-vpc"
cidr = "10.20.0.0/16"
azs = ["us-east-1a", "us-east-1b"]
public_subnets = ["10.20.1.0/24", "10.20.2.0/24"]
private_subnets = ["10.20.11.0/24", "10.20.12.0/24"]
create_igw = true
# New in 6.8.0: skip the module-managed default route on public route
# tables so a custom route (e.g. to a firewall ENI or TGW attachment)
# can be added separately. Confirm this flag name against variables.tf
# for the exact release you pin.
create_public_route_table_default_route = false
tags = {
Environment = "prod"
ManagedBy = "terraform"
}
}
# Add the custom default route yourself once the toggle disables the
# module-managed one.
resource "aws_route" "custom_public_default" {
for_each = toset(module.vpc.public_route_table_ids)
route_table_id = each.value
destination_cidr_block = "0.0.0.0/0"
network_interface_id = aws_instance.firewall.primary_network_interface_id
}No deprecations or breaking changes are listed in the 6.8.0 notes. Existing configurations that don't set the new variable keep today's behavior (default route to the IGW still created), so this is additive and safe for a routine minor-version bump.
For full detail, see the v6.8.0 release page.
Pin the module version to the new release in your module block:
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 6.8.0"
# ...
}Then refresh the module cache and re-plan:
terraform init -upgrade
terraform planBecause the new toggle is additive and off by default (module behavior unchanged unless you explicitly set it), terraform plan should show no infrastructure diff for existing stacks that don't adopt the new variable.
Confirm the module version actually resolved is 6.8.0:
terraform providers
terraform version -json | grep -A2 '"terraform-aws-vpc"' 2>/dev/null || \
cat .terraform/modules/modules.json | grep -i vpcIf you adopted the new default-route toggle, validate the plan shows the public route table's default route being removed (or not created) and your custom aws_route resource being added instead:
terraform plan -target=module.vpc -target=aws_route.custom_public_defaultv6.8.0 is a low-risk, additive release: the only functional change is a new toggle for skipping the module-managed default route on public route tables, aimed at teams with custom egress designs. There are no breaking changes or deprecations to react to, so upgrading is a straightforward version-constraint bump and terraform init -upgrade. Teams that want to use the new toggle should verify the exact variable name against the tagged variables.tf before relying on the example above, since the upstream release notes don't spell it out in full.
Infrastructure as CodeLearn how to use Terraform data sources to query existing resources, look up AMIs, reference remote state, and build dynamic configurations. Complete.
Cloud ComputingMaster multi-account AWS management with Terraform. Learn provider aliases, cross-account IAM roles, AWS Organizations integration, and production-ready.
Cloud ComputingLearn how to implement Terraform state locking with AWS DynamoDB to prevent concurrent modifications and state corruption. Complete setup guide with examples.
DevOpsLearn how to integrate Terraform with GitHub Actions for automated infrastructure deployments. Complete guide with workflows, best practices, and.