36

I am trying to use recently released amazon-ecs-plugin:1.15 which support fargate but I am getting below error.

WARNING: Slave {0} - Cannot create ECS Task
May 24, 2018 1:10:39 PM hudson.slaves.NodeProvisioner$2 run
WARNING: Unexpected exception encountered while provisioning agent ECS Slave ecs-jenkins-slave
com.amazonaws.services.ecs.model.ClientException: No Fargate configuration exists for given values. (Service: AmazonECS; Status Code: 400; Error Code: ClientException; Request ID:****-****)

Here is my config

halfer
  • 19,824
  • 17
  • 99
  • 186
Sourabh
  • 709
  • 1
  • 8
  • 9

2 Answers2

66

Check your CPU and memory amounts; you need to follow specific combinations:

CPU value       Memory value (MiB)
256 (.25 vCPU)  512 (0.5GB), 1024 (1GB), 2048 (2GB)
512 (.5 vCPU)   1024 (1GB), 2048 (2GB), 3072 (3GB), 4096 (4GB) 
1024 (1 vCPU)   2048 (2GB), 3072 (3GB), 4096 (4GB), 5120 (5GB), 6144 (6GB), 7168 (7GB), 8192 (8GB) 
2048 (2 vCPU)   Between 4096 (4GB) and 16384 (16GB) in increments of 1024 (1GB) 
4096 (4 vCPU)   Between 8192 (8GB) and 30720 (30GB) in increments of 1024 (1GB) 

Reference: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-cpu-memory-error.html

Onema
  • 7,331
  • 12
  • 66
  • 102
  • 2
    This worked for me using terraform - the error message was the same "No Fargate configuration exists for given values" – adona9 Jul 11 '19 at 16:07
  • 2
    this also worked for me. Didn't realize that there is a constrain between CPU and Memory value. – Nhat Dinh Jul 29 '20 at 12:16
13

To add to user6327093's answer

I had a similar issue when trying to create resources on AWS ECS using Terraform. The error was:

Error: ClientException: No Fargate configuration exists for given values.

Here's how I fixed it:

You must adhere to the supported task CPU and memory values for tasks that are hosted on Fargate are as follows.

CPU value Memory value (MiB)
256 (.25 vCPU) 512 (0.5GB), 1024 (1GB), 2048 (2GB)
512 (.5 vCPU) 1024 (1GB), 2048 (2GB), 3072 (3GB), 4096 (4GB)
1024 (1 vCPU) 2048 (2GB), 3072 (3GB), 4096 (4GB), 5120 (5GB), 6144 (6GB), 7168 (7GB), 8192 (8GB)
2048 (2 vCPU) Between 4096 (4GB) and 16384 (16GB) in increments of 1024 (1GB)
4096 (4 vCPU) Between 8192 (8GB) and 30720 (30GB) in increments of 1024 (1GB)

In my case, the CPU was 4096, while the memory was 32768 (32GB). However, 32768 (32GB) memory is not supported by Fargate from the table above, so I had to change the memory to 30720 (30GB).

Resources: Invalid CPU or memory value specified

That's all

Promise Preston
  • 24,334
  • 12
  • 145
  • 143