-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.tf
39 lines (34 loc) · 916 Bytes
/
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
resource "random_string" "rand" {
length = 24
special = false
upper = false
}
locals {
namespace = substr(join("-", [var.namespace, random_string.rand.result]), 0, 24)
}
module "networking" {
source = "./modules/networking"
namespace = local.namespace
}
module "database" {
source = "./modules/database"
namespace = local.namespace
rds_user = var.rds_user
rds_password = var.rds_password
sg = module.networking.sg
}
module "lambda" {
source = "./modules/lambda"
namespace = local.namespace
rds_user = var.rds_user
rds_password = var.rds_password
rds_host = module.database.rds_host
rds_port = module.database.rds_port
rds_database = module.database.rds_database
sg = module.networking.sg
}
module "apigw" {
source = "./modules/apigw"
namespace = local.namespace
lambda_arn = module.lambda.lambda_arn
}