Giter Club home page Giter Club logo

d2d-terraform-vpc's Introduction

AWS VPC terraform module

A Terraform module to create an AWS VPC supporting public, private and database subnets plus NAT Gateways

Module Input Variables

  • name - name for the VPC
  • cidr - network block in CIDR notation
  • public_subnets - list of public subnet CIDRs (defaults to empty)
  • private_subnets - list of private subnet CIDRs (defaults to empty)
  • database_subnets - list of private database subnet CIDRs (defaults to empty)
  • azs - list of AZs in which to distribute subnets
  • nat_gateway_count - number of NAT Gateways to create (defaults to -1)
  • enable_dns_hostnames - use private DNS (defaults to true)
  • enable_dns_support - use private DNS (defaults to true)
  • map_public_ip_on_launch - auto-assign public IP on launch (defaults to true)
  • tags - dictionary of tags that will be added to resources created by the module

NAT Gateways

nat_gateway_count result
-1 (default) create one per public subnet
0 do not create any
>= 1 create this many

Usage

1-tier with only private subnets

module "vpc" {
  source = "github.com/door2door-io/d2d-terraform-vpc?ref=v0.0.1"

  name            = "vpc-name"
  cidr            = "10.0.0.0/16"
  private_subnets = ["10.0.101.0/24", "10.0.102.0/24"]
  azs             = ["eu-central-1a", "eu-central-1b"]

  tags {
    "Terraform" = "true"
    "Environment" = "test"
  }
}

2-tier with public and private subnets + 1 shared NAT Gateway

module "vpc" {
  source = "github.com/door2door-io/d2d-terraform-vpc?ref=v0.0.1"

  name              = "vpc-name"
  cidr              = "10.0.0.0/16"
  public_subnets    = ["10.0.1.0/24", "10.0.2.0/24"]
  private_subnets   = ["10.0.101.0/24", "10.0.102.0/24"]
  azs               = ["eu-central-1a", "eu-central-1b"]
  nat_gateway_count = 1

  tags {
    "Terraform" = "true"
    "Environment" = "test"
  }
}

3-tier with public, private and database subnets + NAT Gateways

module "vpc" {
  source = "github.com/door2door-io/d2d-terraform-vpc?ref=v0.0.1"

  name              = "vpc-name"
  cidr              = "10.0.0.0/16"
  public_subnets    = ["10.0.1.0/24", "10.0.2.0/24"]
  private_subnets   = ["10.0.101.0/24", "10.0.102.0/24"]
  database_subnets  = ["10.0.201.0/24", "10.0.202.0/24"]
  azs               = ["eu-central-1a", "eu-central-1b"]
  nat_gateway_count = -1

  tags {
    "Terraform" = "true"
    "Environment" = "test"
  }
}

Outputs

  • vpc_id - ID of the VPC
  • public_subnet_ids - list of public subnet IDs
  • public_route_table_ids - list of public route table IDs
  • private_subnet_ids - list of private subnet IDs
  • private_route_table_ids - list of private route table IDs
  • database_subnet_ids - list of private database subnet IDs
  • database_route_table_ids - list of private database route table IDs
  • database_subnet_group - database subnet group name
  • nat_gateway_ips - list of NAT Gateways public IP addresses

d2d-terraform-vpc's People

Contributors

adamlukemooney avatar askainet avatar norbert avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

askainet

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.