File tree Expand file tree Collapse file tree 5 files changed +20
-20
lines changed Expand file tree Collapse file tree 5 files changed +20
-20
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ module "ecs_service" {
67
67
ecs_cluster_id = data. terraform_remote_state . prerequisites . outputs . cluster_id
68
68
ecs_cluster_service_role_arn = data. terraform_remote_state . prerequisites . outputs . service_role_arn
69
69
70
- fargate = var. fargate
71
- cpu = var. cpu
72
- memory = var. memory
70
+ use_fargate = var. use_fargate
71
+ service_task_cpu = var. service_task_cpu
72
+ service_task_memory = var. service_task_memory
73
73
}
Original file line number Diff line number Diff line change @@ -143,17 +143,17 @@ variable "wait_for_steady_state" {
143
143
default = null
144
144
}
145
145
146
- variable "fargate " {
146
+ variable "use_fargate " {
147
147
type = bool
148
148
default = null
149
149
}
150
150
151
- variable "cpu " {
151
+ variable "service_task_cpu " {
152
152
type = string
153
153
default = null
154
154
}
155
155
156
- variable "memory " {
156
+ variable "service_task_memory " {
157
157
type = string
158
158
default = null
159
159
}
Original file line number Diff line number Diff line change 158
158
end
159
159
end
160
160
161
- describe 'when task_type is fargate' do
161
+ fdescribe 'when task_type is fargate' do
162
162
before ( :context ) do
163
163
@plan = plan ( role : :root ) do |vars |
164
164
vars . attach_to_load_balancer = false
165
- vars . fargate = true
166
- vars . cpu = '256'
167
- vars . memory = '512'
165
+ vars . use_fargate = true
166
+ vars . service_task_cpu = '256'
167
+ vars . service_task_memory = '512'
168
168
end
169
169
end
170
170
191
191
before ( :context ) do
192
192
@plan = plan ( role : :root ) do |vars |
193
193
vars . attach_to_load_balancer = false
194
- vars . cpu = '1234'
195
- vars . memory = '4567'
194
+ vars . service_task_cpu = '1234'
195
+ vars . service_task_memory = '4567'
196
196
vars . service_task_container_definitions =
197
197
'[{"cpu": ${cpu}, "memory": ${memory}}]'
198
198
end
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ locals {
17
17
" $${port}" , var. service_port ),
18
18
" $${region}" , var. region ),
19
19
" $${log_group}" , var. include_log_group ? aws_cloudwatch_log_group. service [0 ]. name : " " ),
20
- " $${cpu}" , var. cpu ),
21
- " $${memory}" , var. memory )
20
+ " $${cpu}" , var. service_task_cpu ),
21
+ " $${memory}" , var. service_task_memory )
22
22
}
23
23
24
24
resource "aws_ecs_task_definition" "service" {
@@ -30,9 +30,9 @@ resource "aws_ecs_task_definition" "service" {
30
30
31
31
task_role_arn = var. service_role
32
32
33
- requires_compatibilities = var. fargate ? [" FARGATE" ] : null
34
- cpu = var. fargate ? var. cpu : null
35
- memory = var. fargate ? var. memory : null
33
+ requires_compatibilities = var. use_fargate ? [" FARGATE" ] : null
34
+ cpu = var. use_fargate ? var. service_task_cpu : null
35
+ memory = var. use_fargate ? var. service_task_memory : null
36
36
37
37
dynamic "volume" {
38
38
for_each = var. service_volumes
Original file line number Diff line number Diff line change @@ -256,20 +256,20 @@ variable "always_use_latest_task_definition" {
256
256
nullable = false
257
257
}
258
258
259
- variable "fargate " {
259
+ variable "use_fargate " {
260
260
description = " Whether or not to use Fargate for the service."
261
261
type = bool
262
262
default = false
263
263
nullable = false
264
264
}
265
265
266
- variable "cpu " {
266
+ variable "service_task_cpu " {
267
267
description = " The number of CPU units to use for the service task when deployed using Fargate."
268
268
type = string
269
269
default = " 256"
270
270
nullable = false
271
271
}
272
- variable "memory " {
272
+ variable "service_task_memory " {
273
273
description = " The amount of memory (in MiB) to use for the service task when deployed using Fargate."
274
274
type = string
275
275
default = " 512"
You can’t perform that action at this time.
0 commit comments