Skip to content

Terraform - Plantilla para crear una Virtual Private Cloud (AWS VPC)

Notifications You must be signed in to change notification settings

punkerside/terraform-aws-vpc

Repository files navigation

Terraform Module - VPC

Build Open Source Helpers GitHub Issues GitHub Tag GitHub release (latest by date)

Usage

module "vpc" {
  source  = "punkerside/vpc/aws"
  version = "0.0.6"

  name           = "titan"
  cidr_block_vpc = "10.0.0.0/16"
  cidr_block_pri = ["10.0.0.0/19", "10.0.32.0/19", "10.0.64.0/19"]
  cidr_block_pub = ["10.0.96.0/19", "10.0.128.0/19", "10.0.160.0/19"]
}

Examples

Requirements

Name Version
terraform >= 1.0.0
aws >= 5.0.0
random >= 3.5.0

Providers

Name Version
aws >= 5.0.0
random >= 3.5.0

Modules

No modules.

Resources

Name Type
aws_eip.this resource
aws_internet_gateway.this resource
aws_nat_gateway.this resource
aws_route_table.private resource
aws_route_table.public resource
aws_route_table_association.private resource
aws_route_table_association.public resource
aws_subnet.private resource
aws_subnet.public resource
aws_vpc.this resource
random_string.this resource
aws_availability_zones.this data source

Inputs

Name Description Type Default Required
cidr_block_pri Segmentos de redes privadas list(string)
[
"10.0.0.0/19",
"10.0.32.0/19",
"10.0.64.0/19"
]
no
cidr_block_pub Segmentos de redes publicas list(string)
[
"10.0.96.0/19",
"10.0.128.0/19",
"10.0.160.0/19"
]
no
cidr_block_vpc Bloque CIDR string "10.0.0.0/16" no
enable_dns_hostnames Activar DNS Hostname bool true no
enable_dns_support Soporte DNS bool true no
name Nombre asignado a todos los recursos creados por esta plantilla string null no

Outputs

Name Description
subnet_private_ids Subnet private ids
subnet_public_ids Subnet public ids
vpc VPC values

Tests

  1. Inicializar automatizacion:
make init
  1. Establecer credenciales:
export AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
export AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
  1. Ejecutar pruebas:
make test_awspec

Docs

make test_precommit

Authors

The module is maintained by Ivan Echegaray