Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine subnet-group module #55

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
":floppy_disk: security-group":
- modules/security-group/**/*

":floppy_disk: subnet-group":
- modules/subnet-group/**/*

":floppy_disk: vpc":
- modules/vpc/**/*
67 changes: 67 additions & 0 deletions examples/vpc-full/nat-gateways.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
###################################################
# Elastic IP
###################################################

module "elastic_ip" {
source = "tedilabs/ipam/aws//modules/elastic-ip"
version = "~> 0.3.0"

name = "nat-gw-test-public/az2"
type = "AMAZON"

tags = {
"project" = "terraform-aws-network-examples"
}
}


###################################################
# Public NAT Gateway
###################################################

module "public_nat_gateway" {
source = "../../modules/nat-gateway"
# source = "tedilabs/network/aws//modules/nat-gateway"
# version = "~> 0.2.0"

name = "test-public/az2"
is_private = false
subnet = module.public_subnet_group.subnets_by_az["use1-az2"][0].id


## Primary IP Address
primary_ip_assignment = {
elastic_ip = module.elastic_ip.id
}


tags = {
"project" = "terraform-aws-network-examples"
}
}


###################################################
# Private NAT Gateway
###################################################

module "private_nat_gateway" {
source = "../../modules/nat-gateway"
# source = "tedilabs/network/aws//modules/nat-gateway"
# version = "~> 0.2.0"

name = "test-private/az2"
is_private = true
subnet = module.private_subnet_group.subnets_by_az["use1-az2"][0].id


## Primary IP Address
primary_ip_assignment = {
private_ip = "10.0.200.7"
}


tags = {
"project" = "terraform-aws-network-examples"
}
}
18 changes: 18 additions & 0 deletions examples/vpc-full/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,21 @@ output "vpc" {
description = "The VPC."
value = module.vpc
}

output "subnet_groups" {
description = "The Subnet Groups for the VPC."
value = {
private = module.private_subnet_group
public = module.public_subnet_group
}
}

output "public_nat_gateways" {
description = "The NAT Gateways in public."
value = module.public_nat_gateway
}

output "private_nat_gateways" {
description = "The NAT Gateways in private."
value = module.private_nat_gateway
}
138 changes: 138 additions & 0 deletions examples/vpc-full/subnet-groups.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
###################################################
# Subnet Groups
###################################################

module "private_subnet_group" {
source = "../../modules/subnet-group"
# source = "tedilabs/network/aws//modules/subnet-group"
# version = "~> 0.2.0"

name = "test/private"

vpc_id = module.vpc.id

subnets = {
"test/private/az2" = {
availability_zone_id = "use1-az2"
ipv4_cidr = "10.0.200.0/24"
}
"test/private/az4" = {
availability_zone_id = "use1-az4"
ipv4_cidr = "10.0.201.0/24"
}
}


## IP Assignments
public_ipv4_address_assignment = {
enabled = false
}
ipv6_address_assignment = {
enabled = false
}
customer_owned_ipv4_address_assignment = {
enabled = false
}


## DNS Configurations
dns_config = {
hostname_type = "RESOURCE_NAME"
dns_resource_name_ipv4_enabled = true
dns_resource_name_ipv6_enabled = false
dns64_enabled = false
}

## Integrations
dax_subnet_group = {
enabled = true
name = "test-dax"
description = "Test DAX Subnet Group"
}
dms_replication_subnet_group = {
enabled = true
name = "test-dms-replication"
description = "Test DMS Replication Subnet Group"
}
docdb_subnet_group = {
enabled = true
name = "test-docdb"
description = "Test DocumentDB Subnet Group"
}
elasticache_subnet_group = {
enabled = true
name = "test-elasticache"
description = "Test ElastiCache Subnet Group"
}
memorydb_subnet_group = {
enabled = true
name = "test-memorydb"
description = "Test MemoryDB Subnet Group"
}
neptune_subnet_group = {
enabled = true
name = "test-neptune"
description = "Test Neptune Subnet Group"
}
rds_subnet_group = {
enabled = true
name = "test-rds"
description = "Test RDS Subnet Group"
}
redshift_subnet_group = {
enabled = true
name = "test-redshift"
description = "Test Redshift Subnet Group"
}

tags = {
"project" = "terraform-aws-network-examples"
}
}

module "public_subnet_group" {
source = "../../modules/subnet-group"
# source = "tedilabs/network/aws//modules/subnet-group"
# version = "~> 0.2.0"

name = "test/public"

vpc_id = module.vpc.id

subnets = {
"test/public/az2" = {
availability_zone_id = "use1-az2"
ipv4_cidr = "10.0.100.0/24"
}
"test/public/az4" = {
availability_zone_id = "use1-az4"
ipv4_cidr = "10.0.101.0/24"
}
}


## IP Assignments
public_ipv4_address_assignment = {
enabled = true
}
ipv6_address_assignment = {
enabled = false
}
customer_owned_ipv4_address_assignment = {
enabled = false
}


## DNS Configurations
dns_config = {
hostname_type = "RESOURCE_NAME"
dns_resource_name_ipv4_enabled = true
dns_resource_name_ipv6_enabled = false
dns64_enabled = false
}


tags = {
"project" = "terraform-aws-network-examples"
}
}
Loading