-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
51 lines (45 loc) · 1.21 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
data "aws_s3_bucket" "monitored_bucket" {
bucket = var.monitored_bucket
}
module "iam" {
source = "./modules/iam"
name = var.name
workspace = terraform.workspace
sns_topic = module.sns.sns_topic_arn
}
module "s3" {
source = "./modules/s3"
name = var.name
workspace = terraform.workspace
}
module "cloudwatch" {
source = "./modules/cloudwatch"
name = var.name
workspace = terraform.workspace
monitored_s3_bucket = data.aws_s3_bucket.monitored_bucket.bucket
lambda_function = module.lambda.lambda_function
}
module "cloudtrail" {
source = "./modules/cloudtrail"
name = var.name
workspace = terraform.workspace
iam_role_arn = module.iam.cloudtrail_role_arn
log_group_arn = module.cloudwatch.cloudtrail_log_group_arn
monitored_s3_bucket_arn = data.aws_s3_bucket.monitored_bucket.arn
depends_on_ = [
module.s3.s3_bucket_policy_id
]
}
module "sns" {
source = "./modules/sns"
name = var.name
workspace = terraform.workspace
monitored_s3_bucket = "${data.aws_s3_bucket.monitored_bucket.bucket}"
}
module "lambda" {
source = "./modules/lambda"
name = var.name
workspace = terraform.workspace
iam_role_arn = module.iam.lambda_role_arn
sns_topic_arn = module.sns.sns_topic_arn
}