# ComputeEnvironmentOrderProperty

The order that compute environments are tried in for job placement within a queue.

Compute environments are tried in ascending order. For example, if two compute environments are associated with a job queue, the compute environment with a lower order integer value is tried for job placement first. Compute environments must be in the `VALID` state before you can associate them with a job queue. All of the compute environments must be either EC2 ( `EC2` or `SPOT` ) or Fargate ( `FARGATE` or `FARGATE_SPOT` ); Amazon EC2 and Fargate compute environments can't be mixed.

> All compute environments that are associated with a job queue must share the same architecture. AWS Batch doesn't support mixing compute environment architecture types in a single job queue.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 2023

## 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';
const computeEnvironmentOrderProperty: batch.CfnJobQueue.ComputeEnvironmentOrderProperty = {
  computeEnvironment: 'computeEnvironment',
  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

compute_environment_order_property = batch.CfnJobQueue.ComputeEnvironmentOrderProperty(
    compute_environment="computeEnvironment",
    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.*;

ComputeEnvironmentOrderProperty computeEnvironmentOrderProperty = ComputeEnvironmentOrderProperty.builder()
        .computeEnvironment("computeEnvironment")
        .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;

var computeEnvironmentOrderProperty = new ComputeEnvironmentOrderProperty {
    ComputeEnvironment = "computeEnvironment",
    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"

computeEnvironmentOrderProperty := &ComputeEnvironmentOrderProperty{
	ComputeEnvironment: jsii.String("computeEnvironment"),
	Order: jsii.Number(123),
}
```

## Properties

- `computeEnvironment`: string (required) — The Amazon Resource Name (ARN) of the compute environment.

- `order`: number (required) — The order of the compute environment.

  Compute environments are tried in ascending order. For example, if two compute environments are associated with a job queue, the compute environment with a lower `order` integer value is tried for job placement first.
