Which of the following is the correct way to specify CPU and memory for a Fargate task definition?
easy📝 Configuration Q12 of 15
AWS - ECS and Fargate
Which of the following is the correct way to specify CPU and memory for a Fargate task definition?
A"cpu": 512, "memory": 1024
B"cpu": "512", "memory": "1024"
C"cpu": "0.5", "memory": "1GB"
D"cpu": "512MB", "memory": "1GB"
Step-by-Step Solution
Solution:
Step 1: Check Fargate task definition format
Fargate expects CPU and memory as strings representing CPU units and MiB memory, e.g., "512" and "1024".
Step 2: Evaluate options
"cpu": "512", "memory": "1024" uses strings with numeric values, which is correct. Using numbers instead of strings is incorrect. Decimal values for CPU or units like GB/MB are invalid.
Final Answer:
"cpu": "512", "memory": "1024" -> Option B
Quick Check:
CPU and memory as strings = B [OK]
Quick Trick:CPU and memory must be strings in task definition [OK]
Common Mistakes:
Using numbers instead of strings
Adding units like MB or GB
Using decimal numbers for CPU
Master "ECS and Fargate" in AWS
9 interactive learning modes - each teaches the same concept differently