-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
65 lines (57 loc) · 1.54 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
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
provider "aws" {
region = var.region
}
locals {
workload = "awsomeapp"
elb_name = "nlb-${local.workload}"
}
module "network" {
source = "./modules/network"
workload = local.workload
region = var.region
}
module "bucket" {
source = "./modules/s3"
elb_account_id = var.elb_account_id
elb_name = local.elb_name
}
module "nlb" {
source = "./modules/nlb"
workload = local.workload
vpc_id = module.network.vpc_id
subnets = module.network.public_subnets
acm_nlb_domain = var.acm_nlb_domain
bucket = module.bucket.bucket
elb_name = local.elb_name
enable_elb_accesslogs = var.enable_elb_accesslogs
}
module "ec2" {
source = "./modules/ec2"
workload = local.workload
vpc_id = module.network.vpc_id
subnets = module.network.public_subnets
target_group = module.nlb.target_group_arn
}
module "jump" {
count = var.create_jumpserver ? 1 : 0
source = "./modules/jump"
workload = local.workload
vpc_id = module.network.vpc_id
subnet = module.network.public_subnets[0]
}
module "vpces_nbl" {
count = var.create_vpces ? 1 : 0
source = "./modules/vpces"
affix = local.workload
vpc_id = module.network.vpc_id
nlb_arn = module.nlb.lb_arn
subnets = module.network.public_subnets
vpces_private_name = var.vpces_private_name
}