-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
59 lines (55 loc) · 2.62 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
terraform {
required_version = ">= 1.3.8"
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.1.2"
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
enable_flow_log = var.vpc.enable_flow_log
create_flow_log_cloudwatch_log_group = var.vpc.create_flow_log_cloudwatch_log_group
create_flow_log_cloudwatch_iam_role = var.vpc.create_flow_log_cloudwatch_iam_role
flow_log_max_aggregation_interval = var.vpc.flow_log_max_aggregation_interval
flow_log_cloudwatch_log_group_name_prefix = var.vpc.flow_log_cloudwatch_log_group_name_prefix
flow_log_cloudwatch_log_group_name_suffix = var.vpc.flow_log_cloudwatch_log_group_name_suffix
vpc_flow_log_tags = var.vpc.vpc_flow_log_tags
enable_dns_hostnames = var.vpc.enable_dns_hostnames
enable_dns_support = var.vpc.enable_dns_support
}
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
allowed_cidrs = module.vpc.private_subnets_cidr_blocks
elasticache_subnet_group_name = module.vpc.elasticache_subnet_group_name
availability_zones = var.vpc.azs
})
alb_config = merge(var.alb_config, {
subnets = module.vpc.public_subnets
certificate_arn = var.certificate_arn
})
ecs_cluster = var.ecs_cluster
fleet_config = var.fleet_config
}