Terraform module for AWS VPC
This is a stable example. It should successfully build out of the box
This examples does is built on Construct Libraries marked "Stable" and does not have any infrastructure prerequisites to build.
This module can be used to deploy a VPC on AWS Cloud Provider......
This module needs Terraform 0.12.23 or newer. You can download the latest Terraform version from here.
Below we are able to check the resources that are being created as part of this module call:
- VPC
To use this module, add the following call to your code:
- Sample Code:
module "vpc" {
source = "git::https://github.com/nitinda/terraform-module-aws-vpc.git?ref=master"
cidr_block = "10.0.0.0/16"
instance_tenancy = "dedicated"
tags = {
Environment = "prod"
Project = "POC"
}
}
module "vpc" {
source = "git::https://github.com/nitinda/terraform-module-aws-vpc.git?ref=master"
cidr_block = "10.0.0.0/16"
tags = {
Environment = "prod"
Project = "POC"
}
}
The variables required in order for the module to be successfully called from the deployment repository are the following:
Variable | Description | Type | Argument Status |
---|---|---|---|
cidr_block | The CIDR block for the VPC | string | Required |
instance_tenancy | A tenancy option for instances launched into the VPC |
string | Optional (Default - Null) |
enable_dns_support | A boolean flag to enable/disable DNS support in the VPC |
bool | Optional (Default - true) |
enable_dns_hostnames | A boolean flag to enable/disable DNS hostnames in the VPC |
bool | Optional (Default - false) |
enable_classiclink | A boolean flag to enable/disable ClassicLink for the VPC |
bool | Optional (Default - false) |
enable_classiclink_dns_support | A boolean flag to enable/disable ClassicLink DNS Support for the VPC |
bool | Optional (Default - false) |
assign_generated_ipv6_cidr_block | Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. |
bool | Optional (Default - false) |
tags | A mapping of tags to assign to the resource | map(string) | Required |
This module has the following outputs:
- arn
- id
- cidr_block
In order for the variables to be accessed at module level please use the syntax below:
module.<module_name>.<output_variable_name>
The output variable is able to be accessed through terraform state file using the syntax below:
data.terraform_remote_state.<layer_name>.<output_variable_name>
Module maintained by Module maintained by the - Nitin Das