v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1424200374.6 KB

Describes one or more of your compute environments.

If you're using an unmanaged compute environment, you can use the DescribeComputeEnvironment operation to determine the ecsClusterArn that you launch your Amazon ECS container instances into.

post/v1/describecomputeenvironments

Query parameters

maxResultsstring

Pagination limit

nextTokenstring

Pagination token

Request body

computeEnvironmentsString[]

A list of up to 100 compute environment names or full Amazon Resource Name (ARN) entries.

maxResultsinteger

The maximum number of cluster results returned by <code>DescribeComputeEnvironments</code> in paginated output. When this parameter is used, <code>DescribeComputeEnvironments</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>DescribeComputeEnvironments</code> request with the returned <code>nextToken</code> value. This value can be between 1 and 100. If this parameter isn't used, then <code>DescribeComputeEnvironments</code> returns up to 100 results and a <code>nextToken</code> value if applicable.

nextTokenstring
<p>The <code>nextToken</code> value returned from a previous paginated <code>DescribeComputeEnvironments</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. This value is <code>null</code> when there are no more results to return.</p> <note> <p>Treat this token as an opaque identifier that's only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note>

Response

Success

nextTokenstring

The <code>nextToken</code> value to include in a future <code>DescribeComputeEnvironments</code> request. When the results of a <code>DescribeComputeEnvironments</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.

Example response

{
  "computeEnvironments": [
    {
      "type": "MANAGED",
      "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/P2OnDemand",
      "computeEnvironmentName": "P2OnDemand",
      "computeResources": {
        "type": "EC2",
        "desiredvCpus": 48,
        "ec2KeyPair": "id_rsa",
        "instanceRole": "ecsInstanceRole",
        "instanceTypes": [
          "p2"
        ],
        "maxvCpus": 128,
        "minvCpus": 0,
        "securityGroupIds": [
          "sg-cf5093b2"
        ],
        "subnets": [
          "subnet-220c0e0a",
          "subnet-1a95556d",
          "subnet-978f6dce"
        ],
        "tags": {
          "Name": "Batch Instance - P2OnDemand"
        }
      },
      "ecsClusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/P2OnDemand_Batch_2c06f29d-d1fe-3a49-879d-42394c86effc",
      "serviceRole": "arn:aws:iam::012345678910:role/AWSBatchServiceRole",
      "state": "ENABLED",
      "status": "VALID",
      "statusReason": "ComputeEnvironment Healthy"
    }
  ]
}