In an AWS Fargate task definition, how should you correctly specify the CPU and memory requirements?
easy📝 Syntax Q3 of 15
AWS - ECS and Fargate
In an AWS Fargate task definition, how should you correctly specify the CPU and memory requirements?
A"cpu": "512", "memory": "1024"
B"cpu": 512, "memory": 1024
C"cpu": "0.5 vCPU", "memory": "1 GB"
D"cpu": "512MB", "memory": "1GB"
Step-by-Step Solution
Solution:
Step 1: Understand Fargate CPU and memory format
Fargate requires CPU and memory values as strings representing CPU units and MiB respectively.
Step 2: Analyze options
"cpu": "512", "memory": "1024" correctly uses strings with numeric values representing CPU units (512) and memory in MiB (1024). "cpu": 512, "memory": 1024 uses numbers without quotes, which is invalid JSON for this context. Options C and D use incorrect units or formats not accepted by Fargate.
Final Answer:
"cpu": "512", "memory": "1024" -> Option A
Quick Check:
CPU and memory must be strings with numeric values [OK]
Quick Trick:Specify CPU and memory as strings with numeric values [OK]
Common Mistakes:
Using numeric values without quotes
Specifying units like 'GB' or 'MB' instead of MiB
Using decimal or fractional CPU values
Master "ECS and Fargate" in AWS
9 interactive learning modes - each teaches the same concept differently