-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
40 lines (32 loc) · 1.17 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
provider "aws" {
region = var.aws_region
}
module "common" {
source = "./modules/common"
}
module "database" {
source = "./modules/database"
default_vpc_id = module.common.default_vpc_id
subnet_a_id = module.common.default_subnet_a_id
subnet_b_id = module.common.default_subnet_b_id
subnet_c_id = module.common.default_subnet_c_id
database_username = var.database_username
database_password = var.database_password
}
module "api" {
source = "./modules/api"
database_sg_id = module.database.database_sg_id
}
module "metabase" {
count = terraform.workspace == "production" ? 1 : 0
source = "./modules/metabase"
aws_region = var.aws_region
default_vpc_id = module.common.default_vpc_id
subnet_a_id = module.common.default_subnet_a_id
subnet_b_id = module.common.default_subnet_b_id
subnet_c_id = module.common.default_subnet_c_id
database_username = var.metabase_database_username
database_password = var.metabase_database_password
encryption_key = var.metabase_encryption_key
lightsoff_database_sg_id = module.database.database_sg_id
}