# OptimalInstanceType

Not a real instance type!

Indicates that Batch will choose one it determines to be optimal
for the workload.

Extends: [InstanceType](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InstanceType.html) › OptimalInstanceType

- Source: [`aws-batch/lib/multinode-job-definition.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-batch/lib/multinode-job-definition.ts#L18)
- Type last changed: v2.99.0 · 28 Sep 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 optimalInstanceType = new batch.OptimalInstanceType();
```

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

optimal_instance_type = batch.OptimalInstanceType()
```

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.*;

OptimalInstanceType optimalInstanceType = new OptimalInstanceType();
```

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 optimalInstanceType = new OptimalInstanceType();
```

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"

optimalInstanceType := awscdk.Aws_batch.NewOptimalInstanceType()
```

## Initializer

TypeScript:

```ts
new OptimalInstanceType()
```

Python:

```python
OptimalInstanceType()
```

Java:

```java
new OptimalInstanceType()
```

C# / .NET:

```csharp
new OptimalInstanceType()
```

Golang:

```go
NewOptimalInstanceType()
```

## Properties

- `architecture`: [InstanceArchitecture](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.InstanceArchitecture.html) — The instance's CPU architecture.

## Methods

- `isBurstable(): boolean` — Return whether this instance type is a burstable instance type.

- `of(instanceClass: InstanceClass, instanceSize: InstanceSize): InstanceType` (static) — Instance type for EC2 instances.

  This class takes a combination of a class and size.

  Be aware that not all combinations of class and size are available, and not all
  classes are available in all regions.

- `sameInstanceClassAs(other: InstanceType): boolean`

- `toString(): string` — Return the instance type as a dotted string.
