# OrderedComputeEnvironment

Assigns an order to a ComputeEnvironment.

The JobQueue will prioritize the lowest-order ComputeEnvironment.

- Source: [`aws-batch/lib/job-queue.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-batch/lib/job-queue.ts#L146)
- Type last changed: v2.234.0 · 8 Jan 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_batch as batch } from 'aws-cdk-lib';
import { aws_batch as interfaces_batch } from 'aws-cdk-lib/interfaces';

declare const computeEnvironmentRef: interfaces_batch.IComputeEnvironmentRef;
const orderedComputeEnvironment: batch.OrderedComputeEnvironment = {
  computeEnvironment: computeEnvironmentRef,
  order: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_batch as batch
from aws_cdk.interfaces import aws_batch as interfaces_batch

# compute_environment_ref: interfaces_batch.IComputeEnvironmentRef

ordered_compute_environment = batch.OrderedComputeEnvironment(
    compute_environment=compute_environment_ref,
    order=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.batch.*;
import software.amazon.awscdk.interfaces.batch.*;

IComputeEnvironmentRef computeEnvironmentRef;

OrderedComputeEnvironment orderedComputeEnvironment = OrderedComputeEnvironment.builder()
        .computeEnvironment(computeEnvironmentRef)
        .order(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Batch;
using Amazon.CDK.Interfaces.Batch;

IComputeEnvironmentRef computeEnvironmentRef;

var orderedComputeEnvironment = new OrderedComputeEnvironment {
    ComputeEnvironment = computeEnvironmentRef,
    Order = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var computeEnvironmentRef IComputeEnvironmentRef

orderedComputeEnvironment := &OrderedComputeEnvironment{
	ComputeEnvironment: computeEnvironmentRef,
	Order: jsii.Number(123),
}
```

## Properties

- `computeEnvironment`: [IComputeEnvironmentRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_batch.IComputeEnvironmentRef.html) (required) — The ComputeEnvironment to link to this JobQueue.

- `order`: number (required) — The order associated with `computeEnvironment`.
