Skip to content

A Terraform module to create anAmazon Web Services (AWS) Virtual Private Cloud (VPC).

Notifications You must be signed in to change notification settings

d3b-center/terraform-aws-vpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-aws-vpc CI

A Terraform module to create an Amazon Web Services (AWS) Virtual Private Cloud (VPC).

Usage

This module creates a VPC alongside a variety of related resources, including:

  • Public and private subnets.
  • Public and private route tables.
  • Elastic IPs.
  • Network interfaces.
  • NAT gateways.
  • An internet gateway
  • An S3 VPC endpoint.
  • VPC endpoints to support AWS Session Manager.

Example usage:

module "vpc" {}
  source = "github.com/d3b-center/terraform-aws-vpc"

  name                               = "Default"
  region                             = "us-east-1"
  cidr_block                         = "10.0.0.0/16"
  private_subnet_cidr_blocks         = ["10.0.1.0/24", "10.0.3.0/24"]
  public_subnet_cidr_blocks          = ["10.0.0.0/24", "10.0.2.0/24"]
  availability_zones                 = ["us-east-1a", "us-east-1b"]

  tags = {}
}

See the examples directory for a complete implementation.

Connecting to the Bastion with Session Manager

After copying the bastion instance ID from the AWS Console, you can start a session:

$ aws ssm start-session --target i-0471c64f8747dadae

Starting session with SessionId: iamuser-0f4532b020626b7be
sh-4.2$

For information about accessing other VPC resources, see How can I use an SSH tunnel through AWS Systems Manager to access my private VPC resources?

Variables

  • name - A name for the VPC (default: Default).
  • region - A valid AWS region to house VPC resources.
  • cidr_block - The CIDR range for the entire VPC (default: 10.0.0.0/16).
  • public_subnet_cidr_blocks - A list of CIDR ranges for public subnets (default: ["10.0.0.0/24", "10.0.2.0/24"]).
  • private_subnet_cidr_blocks - A list of CIDR ranges for private subnets (default: ["10.0.1.0/24", "10.0.3.0/24"]).
  • availability_zones - A list of availability zones for subnet placement (default: ["us-east-1a", "us-east-1b"]).
  • tags - A mapping of keys and values to apply as tags to all resources that support them (default: {}).

Outputs

  • id - ID of the VPC.
  • public_subnet_ids - A list of VPC public subnet IDs.
  • private_subnets_ids - A list of VPC private subnet IDs.
  • cidr_block - The CIDR range for the entire VPC.
  • nat_gateway_ips - Public IP addresses of the VPC NAT gateways.

About

A Terraform module to create anAmazon Web Services (AWS) Virtual Private Cloud (VPC).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •