Skip to content

ParallelTheory/tf_vpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VPC

Introduction

This module creates a VPC structure, with a set of private subnets in listed availability zones, routing through a NAT gateway/public subnet for external connectivity. Additionally, will setup AWS VPC peering with specified targets.

Inputs

Name Description Type Default Required
project_name Name of associated project, for resource tagging string nil yes
vpc_cidr CIDR block for new VPC string "10.0.0.0/16" yes
subnets List of private subnets to create within new VPC list ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] yes
subnet_az List of availability zones, one per subnet list ["us-east-1a", "us-east-1b", "us-east-1c"] yes
public_cidr CIDR block for "public" subnet to house Internet gateway string "10.0.254.0/24" yes
peer_vpc_cidrs List of VPC CIDR blocks with which to establish peering list nil no
peer_vpc_ids List of VPC resource IDs with which to establish peering list nil no
peer_vpc_regions List of regions within which peer VPCs exist list nil no

Outputs

Name Description Type
vpc_id AWS resource ID of new VPC string
vpc_arn AWS ARN of new VPC string
subnet_id List of new private subnet IDs list
subnet_arn List of new private subnet ARNs list
public_subnet_id Resource ID of new public subet string
public_subnet_arn AWS ARN of new public subnet string

Example

provider "aws" {
  region  = "us-east-1"
  version = "~> 2.31.0"
}

module "aws_vpc" {
  source = "github.com/ParallelTheory/tf_vpc"

  project_name = "example_vpc"
  vpc_cidr     = "10.0.0.0/16"
  subnets      = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
  subnet_az    = ["us-east-1a", "us-east-1b", "us-east-1c"]
  public_cidr  = "10.0.254.0/28"

  peer_vpc_cidrs   = ["10.1.0.0/24"]
  peer_vpc_ids     = ["vpc-27cda542"]
  peer_vpc_regions = ["us-east-1"]
}

Authors

Copyright 2019 M. Holger / Parallel Theory LLC, All Rights Reserved

License

TBD

About

Terraform module for AWS VPC creation

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages