Skip to content

next-modnavarro/terraform-aws-destroy-default-vpc

 
 

Repository files navigation

Supports management of all default networking resources in an AWS region. Use this module to lock down those resource by removing ingress/egress rules for the default network ACL and the ingress/egress rules for the default security group rules. These resources are special so please read the accompanying documentation below.

Resources supported:

WARNING: The management of default VPC resources in AWS is meant to close security holes and follow best practices. If you have an architecture that relies on default VPC resources DO NOT use this module until those resources have been moved to non-default resources. Once you apply this module to your architecture it is incredibly hard to undo as simply removing the module will not "reset" any changes made by the module. Please read the linked terraform docs above for more information about managing default resources.

Terraform Versions

Terraform 0.12. Pin module version to ~> 2.X . Submit pull-requests to master branch.

Terraform 0.12. Pin module version to ~> 1X . Submit pull-requests to terraform012 branch.

Terraform 0.11 was never supported.

Usage

# Allows all services to log to bucket
module "default_vpc" {
  source = "trussworks/destroy-default-vpc/aws"
  region = "us-west-2"
}

An example that will apply to all regions in an account:

data "aws_regions" "current" {}

data "aws_availability_zones" "available" {
  state = "available"
}

module "default_vpc" {
  source = "trussworks/destroy-default-vpc/aws"
  for_each = toset(data.aws_regions.current.names)
  region = each.value
}

Requirements

Name Version
terraform ~> 0.13.0
aws ~> 3.0

Providers

Name Version
aws ~> 3.0

Inputs

Name Description Type Default Required
azs List of AZs to manage using only the letters, not full AZ name list
[
"a",
"b",
"c",
"d"
]
no
region AWS Region string "us-west-2" no

Outputs

Name Description
network_acl The Default Network ACL
route_table The Default Route Table
security_group The Default Security Group
subnets The Default Subnets
vpc The Default VPC
vpc_dhcp_options The Default VPC DHCP Options Set

Upgrade Paths

Upgrading from 1.0.0 to TBD

TBD - No upgrade paths yet

Developer Setup

Install dependencies (macOS)

brew install pre-commit terraform terraform-docs

Testing

make test

About

Default VPC resource management for AWS Accounts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 88.0%
  • Makefile 12.0%