Description
aws_default_vpc manages the Region’s default VPC in Terraform. Check which workloads use it.
Potential impact
Default subnet routes and permissive security group rules can leave internal workloads reachable from the internet if they have public addresses.
Remediation
Review subnets, internet routes, and security groups. If workloads need a dedicated network, define an aws_vpc and its subnets. Migrate workloads and verify connectivity before retiring the default VPC.
Examples
Manage the default VPC
hcl
resource "aws_default_vpc" "example" {
tags = {
Name = "Default VPC"
}
}
Define a separate VPC
hcl
resource "aws_vpc" "example" {
cidr_block = "10.0.0.0/16"
instance_tenancy = "default"
tags = {
Name = "main"
}
}
The After example creates the dedicated VPC. Moving existing resources is a separate step.