This repository contains Terraform configuration files that create an AWS Virtual Private Cloud (VPC). This module also sets up subnets for different types of resources, such as public, private and database subnets. Additionally, the module creates and configures a number of other resources, such as default network ACL, default route table, and default security group. It also creates VPC endpoints for services such as S3 and DynamoDB, to allow communication between resources in the VPC and those services without going over the internet.
To view examples for how you can leverage this VPC Module, please see the examples directory.
Name | Version |
---|---|
terraform | >= 0.13.1 |
aws | >= 3.73 |
Name | Version |
---|---|
aws | 5.13.1 |
Name | Type |
---|---|
aws_security_group.vpc_tls | resource |
aws_iam_policy_document.ecr | data source |
aws_security_group.default | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
azs | List of availability zones to deploy into | list(string) |
n/a | yes |
create_database_subnet_group | Create database subnet group | bool |
true |
no |
database_subnets | List of database subnets inside the VPC | list(string) |
[] |
no |
enable_nat_gateway | Enable NAT gateway | bool |
false |
no |
instance_tenancy | Tenancy of instances launched into the VPC. Valid values are "default" or "dedicated". EKS does not support dedicated tenancy. |
string |
"default" |
no |
intra_subnet_tags | Tags to apply to intra subnets | map(string) |
{} |
no |
intra_subnets | List of intra subnets inside the VPC | list(string) |
[] |
no |
name | Name to be used on all resources as identifier | string |
n/a | yes |
private_subnet_tags | Tags to apply to private subnets | map(string) |
{} |
no |
private_subnets | List of private subnets inside the VPC | list(string) |
[] |
no |
public_subnet_tags | Tags to apply to public subnets | map(string) |
{} |
no |
public_subnets | List of public subnets inside the VPC | list(string) |
[] |
no |
secondary_cidr_blocks | List of secondary CIDR blocks for the VPC | list(string) |
[] |
no |
single_nat_gateway | Use a single NAT gateway for all private subnets | bool |
true |
no |
tags | A map of tags to apply to all resources | map(string) |
{} |
no |
vpc_cidr | CIDR block for the VPC | string |
n/a | yes |
vpc_flow_log_permissions_boundary | The ARN of the Permissions Boundary for the VPC Flow Log IAM Role | string |
null |
no |
Name | Description |
---|---|
azs | A list of availability zones in the region |
cgw_arns | List of ARNs of Customer Gateway |
cgw_ids | List of IDs of Customer Gateway |
database_internet_gateway_route_id | ID of the database internet gateway route |
database_ipv6_egress_route_id | ID of the database IPv6 egress route |
database_nat_gateway_route_ids | List of IDs of the database nat gateway route |
database_network_acl_arn | ARN of the database network ACL |
database_network_acl_id | ID of the database network ACL |
database_route_table_association_ids | List of IDs of the database route table association |
database_route_table_ids | List of IDs of database route tables |
database_subnet_arns | List of ARNs of database subnets |
database_subnet_group | ID of database subnet group |
database_subnet_group_name | Name of database subnet group |
database_subnets | List of IDs of database subnets |
database_subnets_cidr_blocks | List of cidr_blocks of database subnets |
database_subnets_ipv6_cidr_blocks | List of IPv6 cidr_blocks of database subnets in an IPv6 enabled VPC |
default_network_acl_id | The ID of the default network ACL |
default_route_table_id | The ID of the default route table |
default_security_group_id | The ID of the security group created by default on VPC creation |
default_vpc_arn | The ARN of the Default VPC |
default_vpc_cidr_block | The CIDR block of the Default VPC |
default_vpc_default_network_acl_id | The ID of the default network ACL of the Default VPC |
default_vpc_default_route_table_id | The ID of the default route table of the Default VPC |
default_vpc_default_security_group_id | The ID of the security group created by default on Default VPC creation |
default_vpc_enable_dns_hostnames | Whether or not the Default VPC has DNS hostname support |
default_vpc_enable_dns_support | Whether or not the Default VPC has DNS support |
default_vpc_id | The ID of the Default VPC |
default_vpc_instance_tenancy | Tenancy of instances spin up within Default VPC |
default_vpc_main_route_table_id | The ID of the main route table associated with the Default VPC |
egress_only_internet_gateway_id | The ID of the egress only Internet Gateway |
elasticache_network_acl_arn | ARN of the elasticache network ACL |
elasticache_network_acl_id | ID of the elasticache network ACL |
igw_arn | The ARN of the Internet Gateway |
igw_id | The ID of the Internet Gateway |
intra_network_acl_arn | ARN of the intra network ACL |
intra_network_acl_id | ID of the intra network ACL |
intra_subnet_arns | List of ARNs of intra subnets |
intra_subnets | List of IDs of intra subnets |
intra_subnets_cidr_blocks | List of cidr_blocks of intra subnets |
intra_subnets_ipv6_cidr_blocks | List of IPv6 cidr_blocks of intra subnets in an IPv6 enabled VPC |
nat_ids | List of allocation ID of Elastic IPs created for AWS NAT Gateway |
nat_public_ips | List of public Elastic IPs created for AWS NAT Gateway |
natgw_ids | List of NAT Gateway IDs |
outpost_network_acl_arn | ARN of the outpost network ACL |
outpost_network_acl_id | ID of the outpost network ACL |
private_ipv6_egress_route_ids | List of IDs of the ipv6 egress route |
private_nat_gateway_route_ids | List of IDs of the private nat gateway route |
private_network_acl_arn | ARN of the private network ACL |
private_network_acl_id | ID of the private network ACL |
private_route_table_association_ids | List of IDs of the private route table association |
private_route_table_ids | List of IDs of private route tables |
private_subnet_arns | List of ARNs of private subnets |
private_subnets | List of IDs of private subnets |
private_subnets_cidr_blocks | List of cidr_blocks of private subnets |
private_subnets_ipv6_cidr_blocks | List of IPv6 cidr_blocks of private subnets in an IPv6 enabled VPC |
public_internet_gateway_ipv6_route_id | ID of the IPv6 internet gateway route |
public_internet_gateway_route_id | ID of the internet gateway route |
public_network_acl_arn | ARN of the public network ACL |
public_network_acl_id | ID of the public network ACL |
public_route_table_association_ids | List of IDs of the public route table association |
public_route_table_ids | List of IDs of public route tables |
public_subnet_arns | List of ARNs of public subnets |
public_subnets | List of IDs of public subnets |
public_subnets_cidr_blocks | List of cidr_blocks of public subnets |
public_subnets_ipv6_cidr_blocks | List of IPv6 cidr_blocks of public subnets in an IPv6 enabled VPC |
redshift_network_acl_arn | ARN of the redshift network ACL |
redshift_network_acl_id | ID of the redshift network ACL |
this_customer_gateway | Map of Customer Gateway attributes |
vgw_arn | The ARN of the VPN Gateway |
vgw_id | The ID of the VPN Gateway |
vpc_arn | The ARN of the VPC |
vpc_cidr_block | The CIDR block of the VPC |
vpc_enable_dns_hostnames | Whether or not the VPC has DNS hostname support |
vpc_enable_dns_support | Whether or not the VPC has DNS support |
vpc_endpoints | Array containing the full resource object and attributes for all endpoints created |
vpc_flow_log_cloudwatch_iam_role_arn | The ARN of the IAM role used when pushing logs to Cloudwatch log group |
vpc_flow_log_destination_arn | The ARN of the destination for VPC Flow Logs |
vpc_flow_log_destination_type | The type of the destination for VPC Flow Logs |
vpc_flow_log_id | The ID of the Flow Log resource |
vpc_id | The ID of the VPC |
vpc_instance_tenancy | Tenancy of instances spin up within VPC |
vpc_ipv6_association_id | The association ID for the IPv6 CIDR block |
vpc_ipv6_cidr_block | The IPv6 CIDR block |
vpc_main_route_table_id | The ID of the main route table associated with this VPC |
vpc_owner_id | The ID of the AWS account that owns the VPC |
vpc_secondary_cidr_blocks | List of secondary CIDR blocks of the VPC |