Skip to content

virsas/terraform_vpc_subnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform_vpc_subnet

Terraform module to create VPC subnets in AWS using terraform

Variables

# name: the name of the VPC subnet
# block: the IP allocation for the subnet. Must be within the VPC block
# zone: Specify in which zone the subnet should be placed.
# public: If allocate public IP by default if this subnet is used by EC2
variable "vpc_subnets_example" { default = { name ="example", block = "10.0.0.0/24", zone = "eu-west-1a", public = "false" } }

Dependency

VPC https://github.com/virsas/terraform_vpc

Terraform example

######################
# VPC subnet variables
######################
variable "vpc_subnets_test_a" { default = { name ="test-a", block = "10.0.0.0/24", zone = "eu-west-1a", public = "false" } }

######################
# VPC subnet
######################
module "vpc_subnet_test_a" {
  source = "git::https://github.com/virsas/terraform_vpc_subnet.git?ref=v1.0.0"
  vpc_id  = module.vpc_main.id
  subnet  = var.vpc_subnets_test_a
}