fleet/terraform/main.tf
Zachary Winnerman 6f4a20bdcd
Customer terraform (#9136)
* Initial work on customer terraform modules.

I'm getting lost so I'll need to start applying stuff to make sure it
works

* Stopping here for now

Next I need to add optional()'s to everything so we can specify partial
structure.https://developer.hashicorp.com/terraform/language/expressions/type-constraints#optional-object-type-attributes

* A random check in

Need to redo basically all variables and fix everything

* Got a lot more working finally!

* RDS and Elasticache now create

* Clean apply, just need debugging

* Should be fully working, just need to make a fully working example

* Everything is working and added a usage example

* Added contributing

* fixup

* Final wiring changes and ran the autodoc command

* Add more docs

* Fixup
2022-12-29 16:28:50 -05:00

42 lines
1.5 KiB
HCL

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
name = var.vpc.name
cidr = var.vpc.cidr
azs = var.vpc.azs
private_subnets = var.vpc.private_subnets
public_subnets = var.vpc.public_subnets
database_subnets = var.vpc.database_subnets
elasticache_subnets = var.vpc.elasticache_subnets
create_database_subnet_group = var.vpc.create_database_subnet_group
create_database_subnet_route_table = var.vpc.create_database_subnet_route_table
create_elasticache_subnet_group = var.vpc.create_elasticache_subnet_group
create_elasticache_subnet_route_table = var.vpc.create_elasticache_subnet_route_table
enable_vpn_gateway = var.vpc.enable_vpn_gateway
one_nat_gateway_per_az = var.vpc.one_nat_gateway_per_az
single_nat_gateway = var.vpc.single_nat_gateway
enable_nat_gateway = var.vpc.enable_nat_gateway
}
module "byo-vpc" {
source = "./byo-vpc"
vpc_config = {
vpc_id = module.vpc.vpc_id
networking = {
subnets = module.vpc.private_subnets
}
}
rds_config = merge(var.rds_config, {
subnets = module.vpc.database_subnets
})
redis_config = merge(var.redis_config, {
subnets = module.vpc.elasticache_subnets
availability_zones = var.vpc.azs
})
alb_config = merge(var.alb_config, {
subnets = module.vpc.public_subnets
certificate_arn = var.certificate_arn
})
}