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" {
135135 ipc_mode = var. ipc_mode
136136 network_mode = var. network_mode
137137 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+
138143 dynamic "placement_constraints" {
139144 for_each = var. placement_constraints
140145 content {
Original file line number Diff line number Diff line change 11[
22 {
33 "command" : null ,
4- "cpu" : null ,
4+ "cpu" : 256 ,
55 "disableNetworking" : false ,
66 "dnsSearchDomains" : null ,
77 "dnsServers" : null ,
4242 },
4343 {
4444 "command" : null ,
45- "cpu" : null ,
45+ "cpu" : 256 ,
4646 "disableNetworking" : false ,
4747 "dnsSearchDomains" : null ,
4848 "dnsServers" : null ,
Original file line number Diff line number Diff line change 11[
22 {
33 "command" : null ,
4- "cpu" : null ,
4+ "cpu" : 256 ,
55 "disableNetworking" : false ,
66 "dnsSearchDomains" : null ,
77 "dnsServers" : null ,
6868 "awslogs-region" : " us-east-1"
6969 }
7070 },
71- "memory" : null ,
71+ "memory" : 512 ,
7272 "memoryReservation" : 512 ,
7373 "mountPoints" : [
7474 {
Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ variable "command" {
88}
99
1010variable "cpu" {
11- default = 0
11+ default = 256
1212 description = " The number of cpu units reserved for the container"
13+ type = number
1314}
1415
1516variable "disableNetworking" {
@@ -95,7 +96,7 @@ variable "interactive" {
9596}
9697
9798variable "ipc_mode" {
98- default = " host "
99+ default = null
99100 description = " The IPC resource namespace to use for the containers in the task"
100101}
101102
@@ -118,8 +119,9 @@ variable "logConfiguration" {
118119}
119120
120121variable "memory" {
121- default = 0
122+ default = 512
122123 description = " The hard limit (in MiB) of memory to present to the container"
124+ type = number
123125}
124126
125127variable "memoryReservation" {
@@ -144,7 +146,7 @@ variable "network_mode" {
144146}
145147
146148variable "pid_mode" {
147- default = " host "
149+ default = null
148150 description = " The process namespace to use for the containers in the task"
149151}
150152
You can’t perform that action at this time.
0 commit comments