# SpotOptionsProperty

Additional configuration when you specify `SPOT` as the `purchaseOption` for the `CreateComputeNodeGroup` API action.

- Source: Generated at build time
- Type last changed: v2.174.0 · 4 Jan 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_pcs as pcs } from 'aws-cdk-lib';
const spotOptionsProperty: pcs.CfnComputeNodeGroup.SpotOptionsProperty = {
  allocationStrategy: 'allocationStrategy',
};
```

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_pcs as pcs

spot_options_property = pcs.CfnComputeNodeGroup.SpotOptionsProperty(
    allocation_strategy="allocationStrategy"
)
```

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

SpotOptionsProperty spotOptionsProperty = SpotOptionsProperty.builder()
        .allocationStrategy("allocationStrategy")
        .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.PCS;

var spotOptionsProperty = new SpotOptionsProperty {
    AllocationStrategy = "allocationStrategy"
};
```

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"

spotOptionsProperty := &SpotOptionsProperty{
	AllocationStrategy: jsii.String("allocationStrategy"),
}
```

## Properties

- `allocationStrategy`: string — The Amazon EC2 allocation strategy AWS PCS uses to provision EC2 instances.

  AWS PCS supports *lowest price* , *capacity optimized* , and *price capacity optimized* . For more information, see [Use allocation strategies to determine how EC2 Fleet or Spot Fleet fulfills Spot and On-Demand capacity](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-allocation-strategy.html) in the *Amazon Elastic Compute Cloud User Guide* . If you don't provide this option, it defaults to *price capacity optimized* .
