-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
77 lines (62 loc) · 1.57 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.19.0"
}
}
}
provider "aws" {
region = var.aws_region
}
module "vpc" {
source = "./modules/vpc"
region = var.aws_region
}
module "efs_unencrypted" {
source = "./modules/efs/unencrypted"
subnet_id = module.vpc.subnet_priv1
vpc_id = module.vpc.vpc_id
}
module "kms" {
source = "./modules/kms"
}
module "efs_encrypted_kms" {
source = "./modules/efs/encrypted"
subnet_id = module.vpc.subnet_priv1
vpc_id = module.vpc.vpc_id
kms_key_id = module.kms.key_arn
}
module "ssm" {
source = "./modules/ssm"
efs_unencrypted_dns_name = module.efs_unencrypted.dns_name
efs_encrypted_dns_name = module.efs_encrypted_kms.dns_name
}
module "ec2-instance" {
source = "./modules/ec2-instance"
vpc_id = module.vpc.vpc_id
az = module.vpc.az1
subnet = module.vpc.subnet_pub1
# Adding dependencies for SSM parameters
depends_on = [
module.ssm,
module.efs_unencrypted,
module.efs_encrypted_kms
]
}
module "cloudwatch" {
source = "./modules/cloudwatch"
}
module "datasync" {
source = "./modules/datasync"
subnet_arn = module.vpc.subnet_priv1_arn
efs_unencrypted_arn = module.efs_unencrypted.efs_arn
efs_unencrypted_sg_arn = module.efs_unencrypted.sg_arn
efs_encrypted_arn = module.efs_encrypted_kms.efs_arn
efs_encrypted_sg_arn = module.efs_encrypted_kms.sg_arn
cloudwatch_log_group_arn = module.cloudwatch.log_group_arn
depends_on = [
module.efs_unencrypted,
module.efs_encrypted_kms
]
}