terraform-community-modules / tf_aws_vpc

[DEPRECATED] Use https://github.com/terraform-aws-modules/terraform-aws-vpc
Other
210 stars 203 forks source link

vpc terraform module

This module is deprecated and terraform-aws-modules/terraform-aws-vpc module published on the Terraform registry should be used instead.

This repository will not have active support any more.


A terraform module to provide a VPC in AWS.

Module Input Variables

It's generally preferable to keep public_subnets, private_subnets, and azs to lists of the same length.

This module optionally creates NAT Gateways (one per availability zone) and sets them as the default gateways for the corresponding private subnets.

Usage

module "vpc" {
  source = "github.com/terraform-community-modules/tf_aws_vpc"

  name = "my-vpc"

  cidr = "10.0.0.0/16"
  private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
  public_subnets  = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]

  enable_nat_gateway = "true"

  azs      = ["us-west-2a", "us-west-2b", "us-west-2c"]

  tags {
    "Terraform" = "true"
    "Environment" = "${var.environment}"
  }
}

For Terraform version older than 0.7.0 use ref=v1.0.0: source = "github.com/terraform-community-modules/tf_aws_vpc?ref=v1.0.0"

Outputs

NOTE: previous versions of this module returned a single string as a route table ID, while this version returns a list.

Authors

Originally created and maintained by Casey Ransom Hijacked by Paul Hinze

License

Apache 2 Licensed. See LICENSE for full details.