-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
47 lines (39 loc) · 1.19 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
# make region variable to user
# NOTE: user needs to have AWS credentials stored in environment variables!
variable "aws_region" {
type = string
description = "Provide the AWS region the architecture should be deployed in."
}
variable "bucket" {
type = string
description = "Provide the name of your S3 bucket."
}
variable "token" {
type = string
description = "Provide the desired name of your Oauth token in Secrets Manager."
}
variable "email" {
type = string
description = "Please enter the e-mail address which should receive error notifications."
}
provider "aws" {
region = var.aws_region
}
data "aws_caller_identity" "current" {}
module "dynamodb" {
source = "./terraform_modules/dynamodb"
reports = ["channel_basic_a2", "channel_combined_a2", "channel_demographics_a1", "channel_sharing_service_a1"]
}
module "secret" {
source = "./terraform_modules/parameter_store"
token = var.token
}
module "lambda" {
source = "./terraform_modules/lambda"
bucket = var.bucket
table_arns = module.dynamodb.table_arns
depends_on = [ module.dynamodb, module.secret ]
secret_arn = module.secret.secret_arn
email = var.email
account_id = data.aws_caller_identity.current.account_id
}