-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
142 lines (139 loc) · 7.71 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
##-----------------------------------------------------------------------------
## auto-scaling module call.
##-----------------------------------------------------------------------------
module "auto-scaling" {
source = "./modules/auto-scaling"
name = var.name
repository = var.repository
environment = var.environment
managedby = var.managedby
delimiter = var.delimiter
label_order = var.label_order
image_id = var.image_id
instance_type = var.instance_type
vpc_id = var.vpc_id
subnet_ids = var.subnet_ids
health_check_type = var.health_check_type
min_size = var.min_size
max_size = var.max_size
spot_max_size = var.spot_max_size
spot_min_size = var.spot_min_size
spot_enabled = var.spot_enabled
spot_scale_down_desired = var.spot_scale_down_desired
spot_scale_up_desired = var.spot_scale_up_desired
scale_up_desired = var.scale_up_desired
scale_down_desired = var.scale_down_desired
schedule_enabled = var.schedule_enabled
spot_schedule_enabled = var.spot_schedule_enabled
scheduler_down = var.scheduler_down
scheduler_up = var.scheduler_up
min_size_scaledown = var.min_size_scaledown
max_size_scaledown = var.max_size_scaledown
spot_min_size_scaledown = var.spot_min_size_scaledown
spot_max_size_scaledown = var.spot_max_size_scaledown
spot_price = var.spot_price
volume_size = var.volume_size
ebs_encryption = var.ebs_encryption
ebs_optimized = var.ebs_optimized
volume_type = var.volume_type
spot_instance_type = var.spot_instance_type
load_balancers = var.load_balancers
target_group_arns = var.target_group_arns
wait_for_capacity_timeout = var.wait_for_capacity_timeout
associate_public_ip_address = var.associate_public_ip_address
enabled = var.enabled
key_name = var.key_name
autoscaling_policies_enabled = var.autoscaling_policies_enabled
memory_reservation_high_threshold_percent = var.memory_reservation_high_threshold_percent
memory_reservation_low_threshold_percent = var.memory_reservation_low_threshold_percent
additional_security_group_ids = var.additional_security_group_ids
lb_security_group = var.lb_security_group
cloudwatch_prefix = var.cloudwatch_prefix
retention_in_days = var.retention_in_days
kms_key_arn = var.kms_key_arn
fargate_cluster_enabled = var.fargate_cluster_enabled
cluster_name = module.ecs.ec2_name
}
##-----------------------------------------------------------------------------
## ecs module call.
##-----------------------------------------------------------------------------
module "ecs" {
source = "./modules/ecs"
name = var.name
repository = var.repository
environment = var.environment
managedby = var.managedby
delimiter = var.delimiter
label_order = var.label_order
enabled = var.enabled
ec2_cluster_enabled = var.ec2_cluster_enabled
fargate_cluster_enabled = var.fargate_cluster_enabled
ecs_settings_enabled = var.ecs_settings_enabled
fargate_cluster_cp = var.fargate_cluster_cp
}
##-----------------------------------------------------------------------------
## service module call.
##-----------------------------------------------------------------------------
module "service" {
source = "./modules/service"
name = var.name
environment = var.environment
managedby = var.managedby
delimiter = var.delimiter
label_order = var.label_order
enabled = var.enabled
ec2_service_enabled = var.ec2_service_enabled
ec2_cluster_name = module.ecs.ec2_id
deployment_maximum_percent = var.deployment_maximum_percent
deployment_minimum_healthy_percent = var.deployment_minimum_healthy_percent
desired_count = var.desired_count
enable_ecs_managed_tags = var.enable_ecs_managed_tags
health_check_grace_period_seconds = var.health_check_grace_period_seconds
ec2_awsvpc_enabled = var.ec2_awsvpc_enabled
propagate_tags = var.propagate_tags
scheduling_strategy = var.scheduling_strategy
ec2_task_definition = module.task-definition.ec2_arn
type = var.type
container_name = var.container_name
container_port = var.container_port
fargate_service_enabled = var.fargate_service_enabled
fargate_cluster_name = module.ecs.fargate_id
platform_version = var.platform_version
fargate_task_definition = module.task-definition.fargate_arn
fargate_capacity_provider_simple = var.fargate_capacity_provider_simple
fargate_capacity_provider_spot = var.fargate_capacity_provider_spot
weight_simple = var.weight_simple
weight_spot = var.weight_spot
base = var.base
subnets = var.subnet_ids
assign_public_ip = var.assign_public_ip
lb_subnet = var.lb_subnet
vpc_id = var.vpc_id
target_type = var.target_type
network_mode = var.network_mode
listener_certificate_arn = var.listener_certificate_arn
}
##-----------------------------------------------------------------------------
## task-definition module call.
##-----------------------------------------------------------------------------
module "task-definition" {
source = "./modules/task-definition"
name = var.name
environment = var.environment
managedby = var.managedby
delimiter = var.delimiter
label_order = var.label_order
enabled = var.enabled
ec2_td_enabled = var.ec2_td_enabled
fargate_td_enabled = var.fargate_td_enabled
task_role_arn = var.task_role_arn
file_name = var.file_name
container_log_group_name = var.container_log_group_name
ipc_mode = var.ipc_mode
pid_mode = var.pid_mode
cpu = var.cpu
memory = var.memory
network_mode = var.network_mode
kms_key_arn = var.kms_key_arn
retention_in_days = var.retention_in_days
}