Back to results for “AWS Batch”
AWS › AWS Batch

What are compute environments in AWS Batch, and how do managed and unmanaged compute environments differ?

Intermediate

Answer

A compute environment defines the actual compute resources AWS Batch uses to run your jobs, and with a managed compute environment, AWS Batch automatically provisions and scales EC2 instances or Fargate resources based on job demand, while an unmanaged compute environment requires you to provision and manage your own compute infrastructure yourself, giving more control at the cost of additional operational responsibility.
aws batch create-compute-environment --compute-environment-name my-compute-env --type MANAGED --compute-resources '{"type":"EC2","minvCpus":0,"maxvCpus":256,"instanceTypes":["optimal"]}'
Real-world example A data analytics team uses a managed compute environment configured with a maximum of two hundred fifty six vCPUs, letting AWS Batch automatically scale up EC2 instances during large processing runs and scale back down to zero when no jobs are queued.

Common follow-ups: What is the benefit of using the optimal instance type setting in a compute environment?;Can AWS Batch use Fargate instead of EC2 for its compute environment?