File tree Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,11 @@ resource "aws_ecs_task_definition" "ecs_task_definition" {
135
135
ipc_mode = var. ipc_mode
136
136
network_mode = var. network_mode
137
137
pid_mode = var. pid_mode
138
+
139
+ # Fargate requires cpu and memory to be defined at the task level
140
+ cpu = var. cpu
141
+ memory = var. memory
142
+
138
143
dynamic "placement_constraints" {
139
144
for_each = var. placement_constraints
140
145
content {
Original file line number Diff line number Diff line change 1
1
[
2
2
{
3
3
"command" : null ,
4
- "cpu" : null ,
4
+ "cpu" : 256 ,
5
5
"disableNetworking" : false ,
6
6
"dnsSearchDomains" : null ,
7
7
"dnsServers" : null ,
42
42
},
43
43
{
44
44
"command" : null ,
45
- "cpu" : null ,
45
+ "cpu" : 256 ,
46
46
"disableNetworking" : false ,
47
47
"dnsSearchDomains" : null ,
48
48
"dnsServers" : null ,
Original file line number Diff line number Diff line change 1
1
[
2
2
{
3
3
"command" : null ,
4
- "cpu" : null ,
4
+ "cpu" : 256 ,
5
5
"disableNetworking" : false ,
6
6
"dnsSearchDomains" : null ,
7
7
"dnsServers" : null ,
68
68
"awslogs-region" : " us-east-1"
69
69
}
70
70
},
71
- "memory" : null ,
71
+ "memory" : 512 ,
72
72
"memoryReservation" : 512 ,
73
73
"mountPoints" : [
74
74
{
Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ variable "command" {
8
8
}
9
9
10
10
variable "cpu" {
11
- default = 0
11
+ default = 256
12
12
description = " The number of cpu units reserved for the container"
13
+ type = number
13
14
}
14
15
15
16
variable "disableNetworking" {
@@ -95,7 +96,7 @@ variable "interactive" {
95
96
}
96
97
97
98
variable "ipc_mode" {
98
- default = " host "
99
+ default = null
99
100
description = " The IPC resource namespace to use for the containers in the task"
100
101
}
101
102
@@ -118,8 +119,9 @@ variable "logConfiguration" {
118
119
}
119
120
120
121
variable "memory" {
121
- default = 0
122
+ default = 512
122
123
description = " The hard limit (in MiB) of memory to present to the container"
124
+ type = number
123
125
}
124
126
125
127
variable "memoryReservation" {
@@ -144,7 +146,7 @@ variable "network_mode" {
144
146
}
145
147
146
148
variable "pid_mode" {
147
- default = " host "
149
+ default = null
148
150
description = " The process namespace to use for the containers in the task"
149
151
}
150
152
You can’t perform that action at this time.
0 commit comments