Skill 3.1.4
Apply application requirements for resources (for example, memory, cores)
Key Concepts
For Lambda you set memory from 128 MB to 10,240 MB, which also determines CPU (up to six vCPUs), plus ephemeral storage and the timeout. For ECS you set CPU and memory at the task and container level in the task definition; Fargate supports specific CPU and memory combinations. For EC2 and Elastic Beanstalk you choose instance types sized for the workload.
These requirements should be defined in infrastructure as code (SAM, CloudFormation or CDK) so they are versioned and consistent across environments. CloudWatch metrics such as Lambda duration and max memory used, and CloudWatch Lambda Insights, help right-size them.