-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
29 lines (26 loc) · 872 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
# --- root main.tf ---
module "networking" {
source = "./modules/networking"
security_groups = local.security_groups
vpc_cidr = "10.0.0.0/16"
public_subnet_cidr = "10.0.1.0/24"
subnet-az = var.az
}
module "file-storage" {
source = "./modules/file-storage"
efs_subnet = module.networking.public_subnet_id
efs_mount_sg = module.networking.efs_sg
}
module "compute" {
source = "./modules/compute"
depends_on = [module.file-storage]
instance_count = 1
instance_ami = "ami-0c2b8ca1dad447f8a"
instance_type = "t2.micro"
user_data_path = "${path.cwd}/userdata.tpl"
security_group = module.networking.ec2_sg[0]
ec2_subnet_id = module.networking.public_subnet_id
efs_id = module.file-storage.fs_id
efs_aws_region = var.aws_region
fs_ip = module.file-storage.fs_ip
}