-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
45 lines (33 loc) · 1.7 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
# Using data here to not hardcode acct numbers or regions
data "aws_caller_identity" "development" { provider = aws.development }
data "aws_region" "development" { provider = aws.development }
data "aws_caller_identity" "testing" { provider = aws.testing }
data "aws_region" "testing" { provider = aws.testing }
data "aws_caller_identity" "production" { provider = aws.production }
data "aws_region" "production" { provider = aws.production }
# Setup the orchistration account lambda
module "orchistration_lambda" {
source = "./orchistration-lambda"
providers = { aws = aws.orchistration }
development_lambda_arn = "arn:aws:lambda:${data.aws_region.development.name}:${data.aws_caller_identity.development.account_id}:function:get-hello-rp"
testing_lambda_arn = "arn:aws:lambda:${data.aws_region.testing.name}:${data.aws_caller_identity.testing.account_id}:function:get-hello-rp"
production_lambda_arn = "arn:aws:lambda:${data.aws_region.production.name}:${data.aws_caller_identity.production.account_id}:function:get-hello-rp"
}
# Setup the development lambda
module "development_lambda" {
source = "./account-lambda"
providers = { aws = aws.development }
orchistration_principal_arn = module.orchistration_lambda.orchistration_lambda_principal_arn
}
# Setup the testing lambda
module "testing_lambda" {
source = "./account-lambda"
providers = { aws = aws.testing }
orchistration_principal_arn = module.orchistration_lambda.orchistration_lambda_principal_arn
}
# Setup the production lambda
module "production_lambda" {
source = "./account-lambda"
providers = { aws = aws.production }
orchistration_principal_arn = module.orchistration_lambda.orchistration_lambda_principal_arn
}