Difference between revisions of "Terraform module: vpc"
Jump to navigation
Jump to search
Line 57: | Line 57: | ||
name = "vpcsinglezone" | name = "vpcsinglezone" | ||
− | cidr = "192.168.0.0/16" | + | [[cidr]] = "192.168.0.0/16" |
azs = [[eu-west-1a]] | azs = [[eu-west-1a]] | ||
public_subnets = ["192.168.0.0/24"] | public_subnets = ["192.168.0.0/24"] |
Revision as of 21:29, 6 June 2022
https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest
Contents
Official example
module "vpc" { source = "terraform-aws-modules/vpc/aws" name = "my-vpc" cidr = "10.0.0.0/16" azs = ["eu-west-1a", "eu-west-1b", "eu-west-1c"] private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"] enable_nat_gateway = true enable_vpn_gateway = true tags = { Terraform = "true" Environment = "dev" } }
Additional examples
module "vpc" { source = "terraform-aws-modules/vpc/aws" version = "3.2.0" name = "education-vpc" cidr = "10.0.0.0/16" azs = data.aws_availability_zones.available.names private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"] public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"] enable_nat_gateway = true single_nat_gateway = true enable_dns_hostnames = true tags = { "kubernetes.io/cluster/${local.cluster_name}" = "shared" } public_subnet_tags = { "kubernetes.io/cluster/${local.cluster_name}" = "shared" "kubernetes.io/role/elb" = "1" } private_subnet_tags = { "kubernetes.io/cluster/${local.cluster_name}" = "shared" "kubernetes.io/role/internal-elb" = "1" } }
Simple 1 zone VPC with access to RDS
module "vpc" { source = "terraform-aws-modules/vpc/aws" version = "3.2.0" name = "vpcsinglezone" cidr = "192.168.0.0/16" azs = eu-west-1a public_subnets = ["192.168.0.0/24"] enable_nat_gateway = true single_nat_gateway = true enable_dns_hostnames = true enable_dns_support = true create_database_subnet_group = true create_database_subnet_route_table = true create_database_internet_gateway_route = true tags = { Terraform = "true" Environment = "dev" } }
Related
See also
- AWS VPC, AWS default VPC, AWS VPC sharing, AWS subnets, Amazon VPC NAT gateway, Amazon VPN internet gateway, VPC Flow Logs,
aws ec2 create-vpc
,aws ec2 describe-vpcs
, NACL, VPC Scenarios, AWS VPC endpoint, AWS ClassicLink, VPC peering, Reachability Analyzer, AWS internet gateway, VPC Lattice,vpce.amazonaws.com
- Terraform modules,
terraform get
,module { source }
, AWS modules,module.
, child modules, Terraform modules inputs, submodules,terraform init -upgrade
Advertising: