Skip to content

Commit

Permalink
Add base VPC config for dev and prod environments
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanDumortier committed Apr 19, 2024
1 parent 4e25d33 commit c7c7c7f
Showing 1 changed file with 14 additions and 51 deletions.
65 changes: 14 additions & 51 deletions vpc.tf
Original file line number Diff line number Diff line change
@@ -1,69 +1,32 @@
######################################
# VPC configuration for landing zone
# Development VPC
######################################

#
# Minimal example of VPC setup for development environment
#
module "vpc_dev" {
source = "github.com/peinser/tf-aws-landingzone-module-vpc"

env = "dev"
create_vpc = true
env = "dev"

vpc_name = "vpc-dev"
vpc_cidr = "10.0.0.0/16"
}

#
# Minimal example of VPC setup for production environment
#
module "vpc_prod" {
source = "github.com/peinser/tf-aws-landingzone-module-vpc"
# ------------------------------------------------------------------------------------

env = "prod"

# VPC
vpc_name = "prod"
vpc_cidr = "10.1.0.0/16"

# VPC flow logs
vpc_flow_logs_retention_days = 60

# NAT gateway
nat_gateway_per_az = true
}
######################################
# Production VPC
######################################

#
# Full example of VPC setup with all variables
#
module "vpc_complete_example" {
module "vpc_prod" {
source = "github.com/peinser/tf-aws-landingzone-module-vpc"

create_vpc = true
env = "dev"

# VPC
vpc_name = "vpc-dev"
vpc_cidr = "10.0.0.0/16"

# VPC flow logs
create_vpc_flow_logs = true # default: true if env == prod
vpc_flow_logs_retention_days = 7
vpc_flow_logs_aggregation_interval = 600

# Subnets
create_database_subnets = true
private_subnet_name_prefix = "private"
public_subnet_name_prefix = "public"
database_subnet_name_prefix = "database"
env = "prod"

private_subnet_cidr_blocks = ["10.0.1.0/24", "10.0.2.0/24"] # default used values when omitted
public_subnet_cidr_blocks = ["10.0.100.0/24", "10.0.101.0/24"] # default used values when omitted
database_subnet_cidr_blocks = ["10.0.10.0/24", "10.0.11.0/24"] # default used values when omitted

# NAT gateway
create_nat_gateways = true
single_nat_gateway = true # default: false if env == prod
nat_gateway_per_az = false # default: true if env == prod
vpc_name = "vpc-prod"
vpc_cidr = "10.1.0.0/16"

# VPC endpoints
create_vpc_endpoints = true # currently only an S3 endpoint is configured
single_nat_gateway = true
}

0 comments on commit c7c7c7f

Please sign in to comment.