-
Notifications
You must be signed in to change notification settings - Fork 21
/
main.tf
86 lines (66 loc) · 2.38 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
78
79
80
81
82
83
84
85
provider "aws" {
region = "${var.aws_region}"
}
module "vpc" {
source = "./vpc"
admin_cidr_ingress = "${var.admin_cidr_ingress}"
}
module "cloudwatch" {
source = "./cloudwatch"
}
module "iam" {
source = "./iam"
app_log_group_arn = "${module.cloudwatch.app_log_group_arn}"
ecs_log_group_arn = "${module.cloudwatch.ecs_log_group_arn}"
}
module "ec2" {
source = "./ec2"
aws_region = "${var.aws_region}"
key_name = "${var.key_name}"
ecs_log_level = "${var.ecs_log_level}"
ecs_cluster_name = "${var.ecs_cluster_name}"
vpc_zone_identifier = "${module.vpc.vpc_zone_identifier}"
app_iam_instance_profile_name = "${module.iam.app_iam_instance_profile_name}"
instance_sg_id = "${module.vpc.instance_sg_id}"
ecs_log_group_name = "${module.cloudwatch.ecs_log_group_name}"
}
module "alb" {
source = "./alb"
vpc_id = "${module.vpc.vpc_id}"
subnet_ids = "${module.vpc.public_subnet_ids}"
security_groups = "${module.vpc.security_groups}"
certificate_arn = "${module.dns.acm_certificate_arn}"
}
module "rds" {
source = "./rds"
vpc_id = "${module.vpc.vpc_id}"
public_subnet_ids = "${module.vpc.public_subnet_ids}"
private_subnet_ids = "${module.vpc.private_subnet_ids}"
public_subnet_cidr = "${module.vpc.public_subnet_cidr}"
private_subnet_cidr = "${module.vpc.private_subnet_cidr}"
instance_security_group = "${module.vpc.instance_sg_id}"
}
module "ecs" {
source = "./ecs"
keycloak_admin_username = "${var.keycloak_admin_username}"
keycloak_admin_password = "${var.keycloak_admin_password}"
app_log_group_name = "${module.cloudwatch.app_log_group_name}"
aws_region = "${var.aws_region}"
ecs_iam_role_name = "${module.iam.ecs_iam_role_name}"
alb_target_group_arn = "${module.alb.alb_target_group_arn}"
ecs_cluster_name = "${var.ecs_cluster_name}"
ecs_service_iam_role_policy = "${module.iam.ecs_service_iam_role_policy}"
alb_listener_front_end = "${module.alb.alb_listener_front_end_tls}"
database_hostname = "${module.rds.database_hostname}"
database_port = "${module.rds.database_port}"
database_name = "${module.rds.database_name}"
database_username = "${module.rds.database_username}"
database_password = "${module.rds.database_password}"
}
module "dns" {
source = "./dns"
zone_name = "${var.zone_name}"
public_dns_name = "${var.public_dns_name}"
alb_dns_name = "${module.alb.alb_dns_name}"
alb_zone_id = "${module.alb.alb_zone}"
}