Configures an AWS Batch compute environment using Fargate for serverless compute capabilities.

Terraform Template

resource "aws_batch_compute_environment" "sample" {
  compute_environment_name = "sample"

  compute_resources {
    max_vcpus = 16
    security_group_ids = ["aws_security_group.sample.id"]
    subnets = ["aws_subnet.sample.id"]
    type = "FARGATE"
  }
  depends_on = ["aws_iam_role_policy_attachment.aws_batch_service_role"]
  service_role = "aws_iam_role.aws_batch_service_role.arn"
  type = "MANAGED"
}