Module responsible for creation of VPC on AWS using Terraform
You need first clone this repo in you project or use this as module in your git repo.
For creation, you just need pass some variable:
# Region on AWS
variable "aws_region" {
type = string
description = "AWS Region"
default = "us-east-2"
}
# CIDR of new VPC
variable "vpc_cidr" {
type = string
description = "CIDR block for VPC"
default = "10.0.0.0/16"
}
# Map With tags that you want/need
variable "tags" {
default = {
environment = "test"
}
}
And after creation the VPC ID and VPC CIDR will be output for usage by others modules.
You can test this module using Terratest (for more information here) executing test located on repo_root/test/aws_vpc:
go test