forked from aws-ia/ecs-blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariables.tf
More file actions
254 lines (213 loc) · 6.44 KB
/
variables.tf
File metadata and controls
254 lines (213 loc) · 6.44 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
variable "aws_region" {
description = "AWS region"
type = string
}
variable "core_stack_name" {
description = "The name of core infrastructure stack that you created using core-infra module"
type = string
}
variable "vpc_tag_key" {
description = "The tag key of the VPC and subnets"
type = string
default = "Name"
}
variable "vpc_tag_value" {
# if left blank then {core_stack_name} will be used
description = "The tag value of the VPC and subnets"
type = string
default = ""
}
variable "public_subnets_tag_value" {
# if left blank then {core_stack_name}-public- will be used
description = "The value tag of the public subnets"
type = string
default = ""
}
variable "private_subnets_tag_value" {
# if left blank then {core_stack_name}-private- will be used
description = "The value tag of the private subnets"
type = string
default = ""
}
variable "ecs_cluster_name" {
# if left blank then {core_stack_name} will be used
description = "The ID of the ECS cluster"
type = string
default = ""
}
variable "ecs_task_execution_role_name" {
# if left blank then {core_stack_name}-execution will be used
description = "The ARN of the task execution role"
type = string
default = ""
}
# Application variables
variable "buildspec_path" {
description = "The location of the buildspec file"
type = string
default = "./application-code/ecsdemo-frontend/templates/buildspec.yml"
}
variable "folder_path" {
description = "The location of the application code and Dockerfile files"
type = string
default = "./application-code/ecsdemo-frontend/."
}
variable "repository_owner" {
description = "The name of the owner of the Github repository"
type = string
}
variable "repository_name" {
description = "The name of the Github repository"
type = string
default = "ecs-blueprints"
}
variable "repository_branch" {
description = "The name of branch the Github repository, which is going to trigger a new CodePipeline excecution"
type = string
default = "main"
}
variable "github_token_secret_name" {
description = "The name of branch the Github repository, which is going to trigger a new CodePipeline excecution"
type = string
}
# application related input parameters
variable "service_name" {
description = "The service name"
type = string
default = "ecsdemo-frontend"
}
variable "namespace" {
description = "The service discovery namespace"
type = string
default = "default"
}
variable "desired_count" {
description = "The number of task replicas for service"
type = number
default = 1
}
variable "backend_svc_endpoint" {
description = "The FQDN DNS name of the backend service"
type = string
default = ""
}
# listener settings for the load balanced service
variable "listener_port" {
description = "The listener port"
type = number
default = 80
}
variable "listener_protocol" {
description = "The listener protocol"
type = string
default = "HTTP"
}
# target health check
variable "health_check_path" {
description = "The health check path"
type = string
default = "/"
}
# variable "health_check_protocol" {
# description = "The health check protocol"
# type = string
# default = "http"
# }
variable "health_check_matcher" {
description = "The health check passing codes"
type = string
default = "200-299"
}
################################################################################
# Task definition parameters
################################################################################
variable "cpu" {
description = "The task vCPU size"
type = number
}
variable "memory" {
description = "The task memory size"
type = number
}
variable "container_name" {
description = "The container name to use in service task definition"
type = string
default = "ecsdemo-frontend"
}
################################################################################
# Container definition used in task
################################################################################
variable "container_definition_defaults" {
description = "Default values to use on all container definitions created if a specific value is not specified"
type = any
default = {}
}
variable "container_port" {
description = "The container port to serve traffic"
type = number
default = 3000
}
variable "container_protocol" {
description = "The container traffic protocol"
type = string
default = "HTTP"
}
# Capacity provider strategy setting
# to distribute tasks between Fargate
# Fargate Spot
variable "cp_strategy_base" {
description = "Base number of tasks to create on Fargate on-demand"
type = number
default = 1
}
variable "cp_strategy_fg_weight" {
description = "Relative number of tasks to put in Fargate"
type = number
default = 1
}
variable "cp_strategy_fg_spot_weight" {
description = "Relative number of tasks to put in Fargate Spot"
type = number
default = 0
}
# schedule scaling
variable "enable_scheduled_autoscaling" {
description = "Determines whether scheduled autoscaling is enabled for the service"
type = bool
default = false
}
variable "scheduled_autoscaling_timezone" {
description = "Timezone which scheduled scaling occurs"
type = string
default = "America/Los_Angeles"
}
variable "scheduled_autoscaling_up_time" {
description = "Timezone which scheduled scaling occurs"
type = string
default = "cron(0 6 * * ? *)"
}
variable "scheduled_autoscaling_down_time" {
description = "Timezone which scheduled scaling occurs"
type = string
default = "cron(0 20 * * ? *)"
}
variable "scheduled_autoscaling_up_min_capacity" {
description = "The minimum number of tasks to provision"
type = number
default = 4
}
variable "scheduled_autoscaling_up_max_capacity" {
description = "The maximum number of tasks to provision"
type = number
default = 6
}
variable "scheduled_autoscaling_down_min_capacity" {
description = "The minimum number of tasks to provision"
type = number
default = 1
}
variable "scheduled_autoscaling_down_max_capacity" {
description = "The maximum number of tasks to provision"
type = number
default = 3
}