Skip to content

opsd-io/terraform-module-aws-network

Repository files navigation

OPSd

Meet OPSd. The unique and effortless way of managing cloud infrastructure.

terraform-module-aws-network

Introduction

This Terraform module creates VPC, subnets, gateways and few other network related resources. Is is complete "network" layer for your infrastructure.

Usage

module "network" {
  source  = "github.com/opsd/terraform-module-aws-network"

  vpc_name   = "test-vpc"
  cidr_block = "10.100.0.0/16"
}

IMPORTANT: Make sure not to pin to master because there may be breaking changes between releases.

Requirements

Name Version
terraform >= 1.3.1
aws ~> 5.0

Providers

Name Version
aws ~> 5.0

Modules

No modules.

Resources

Name Type
aws_eip.nat_gateway resource
aws_internet_gateway.main resource
aws_nat_gateway.main resource
aws_route.private_nat resource
aws_route.public_igw resource
aws_route_table.private resource
aws_route_table.public_group resource
aws_route_table_association.private resource
aws_route_table_association.public resource
aws_subnet.private resource
aws_subnet.public resource
aws_vpc.main resource
aws_vpc_ipv4_cidr_block_association.main resource
aws_vpn_gateway.main resource
aws_availability_zones.current data source
aws_region.current data source

Inputs

Name Description Type Default Required
additional_cidr_blocks The additional IPv4 CIDR blocks for the VPC. set(string) [] no
cidr_block The main IPv4 CIDR block for the VPC. string n/a yes
common_tags A map of tags to assign to every resource in this module. map(string) {} no
igw_name The 'Name' tag of Internet Gateway. string null no
private_subnet_groups Private subnet groups definition map. See examples for details.
map(object({
hostname_type = optional(string, null) # Valid values: ip-name, resource-name.
extra_tags = optional(map(string), {})
nat_group_name = optional(string, null) # name of public_subnet_group, ie. 'public1'
nat_group_zone = optional(string, null) # zone suffix, ie. 'b'
availability_zones = map(object({
cidr_block = string
extra_tags = optional(map(string), {})
nat_group_name = optional(string, null) # name of public_subnet_group, ie. 'public1'
nat_group_zone = optional(string, null) # zone suffix, ie. 'b'
}))
}))
{} no
public_subnet_groups Public subnet groups definition map. See examples for details.
map(object({
hostname_type = optional(string, null) # Valid values: ip-name, resource-name.
extra_tags = optional(map(string), {})
nat_gateway = optional(bool, false)
availability_zones = map(object({
cidr_block = string
extra_tags = optional(map(string), {})
nat_gateway = optional(bool, null)
}))
}))
{} no
vgw_name The 'Name' tag of VPN Gateway. string null no
vpc_name The 'Name' tag of VPC. string n/a yes

Outputs

Name Description
availability_zones A map of AZ prefixes and their full names.
internet_gateway_arn The ARN of the Internet Gateway.
internet_gateway_id The ID of the Internet Gateway.
private_subnet_groups Private subnet groups attributes (id, arn, etc.).
private_subnets Flattened version of private_subnet_groups.
public_subnet_groups Public subnet groups attributes (id, arn, etc.).
public_subnets Flattened version of public_subnet_groups.
vpc_arn The ARN of the VPC.
vpc_id The ID of the VPC.
vpn_gateway_arn The ARN of the VPN Gateway.
vpn_gateway_id The ID of the VPN Gateway.

Examples of usage

Do you want to see how the module works? See all the usage examples.

Related modules

The list of related modules (if present).

Contributing

If you are interested in contributing to the project, see see our guide.

Support

If you have a problem with the module or want to propose a new feature, you can report it via the project's (Github) issue tracker.

If you want to discuss something in person, you can join our community on Slack.

License

Apache License 2.0

About

Terraform module for creating AWS network (VPC).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages