This module provisions essential network components of AWS.
The resulting resources include
- A VPC
- Public subnets (arbitrary numbers)
- Private subnets (arbitrary numbers)
- Route tables
- An internet gateway, if needed
- A NAT gateway and the associated Elastic IP, if needed
- Security groups
# in `main.tf`
module "network" {
source = "github.com/uniglot/aws-networking-template"
project_name = "module-test"
vpc_cidr = "10.0.1.0/24"
pub_sub_cidrs = ["10.0.1.0/25"]
pri_sub_cidrs = ["10.0.1.128/25"]
ssh_allowed_cidrs = ["123.123.12.3/32"]
}
Name | Type |
---|---|
aws_eip.eip | resource |
aws_internet_gateway.igw | resource |
aws_nat_gateway.nat | resource |
aws_route.private | resource |
aws_route.public | resource |
aws_route_table.private | resource |
aws_route_table.public | resource |
aws_route_table_association.private | resource |
aws_route_table_association.public | resource |
aws_security_group.private_access | resource |
aws_security_group.public_access | resource |
aws_subnet.private | resource |
aws_subnet.public | resource |
aws_vpc.this | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
pri_sub_cidrs | List of CIDR blocks of private subnets. | list(string) |
[] |
no |
project_name | Project name that will be used as a name prefix of all resources. | string |
n/a | yes |
pub_sub_cidrs | List of CIDR blocks of public subnets. | list(string) |
[] |
no |
ssh_allowed_cidrs | List of CIDR blocks that are allowed for SSH | list(string) |
n/a | yes |
vpc_cidr | The IPv4 CIDR block for the VPC. | string |
n/a | yes |
Name | Description |
---|---|
elastic_ip | Elastic IP associated with NAT gateway. |
igw_id | Internet gateway ID |
nat_id | NAT gateway ID |
pri_rt_id | Private route table's ID |
pri_sub_ids | List of private subnet IDs |
private_sec_group_id | Private security group's ID |
pub_rt_id | Public route table's ID |
pub_sub_ids | List of public subnet IDs |
public_sec_group_id | Public security group's ID |
vpc_id | VPC ID |