# InstanceMarketOptionsProperty

Struct · External

Specifies the market (purchasing) option for an instance.

`InstanceMarketOptions` is a property of the [AWS::EC2::LaunchTemplate LaunchTemplateData](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-launchtemplatedata.html) .

- 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_ec2 as ec2 } from 'aws-cdk-lib';
const instanceMarketOptionsProperty: ec2.CfnLaunchTemplate.InstanceMarketOptionsProperty = {
  marketType: 'marketType',
  spotOptions: {
    blockDurationMinutes: 123,
    instanceInterruptionBehavior: 'instanceInterruptionBehavior',
    maxPrice: 'maxPrice',
    spotInstanceType: 'spotInstanceType',
    validUntil: 'validUntil',
  },
};
```

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_ec2 as ec2

instance_market_options_property = ec2.CfnLaunchTemplate.InstanceMarketOptionsProperty(
    market_type="marketType",
    spot_options=ec2.CfnLaunchTemplate.SpotOptionsProperty(
        block_duration_minutes=123,
        instance_interruption_behavior="instanceInterruptionBehavior",
        max_price="maxPrice",
        spot_instance_type="spotInstanceType",
        valid_until="validUntil"
    )
)
```

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

InstanceMarketOptionsProperty instanceMarketOptionsProperty = InstanceMarketOptionsProperty.builder()
        .marketType("marketType")
        .spotOptions(SpotOptionsProperty.builder()
                .blockDurationMinutes(123)
                .instanceInterruptionBehavior("instanceInterruptionBehavior")
                .maxPrice("maxPrice")
                .spotInstanceType("spotInstanceType")
                .validUntil("validUntil")
                .build())
        .build();
```

C#:

```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.EC2;

var instanceMarketOptionsProperty = new InstanceMarketOptionsProperty {
    MarketType = "marketType",
    SpotOptions = new SpotOptionsProperty {
        BlockDurationMinutes = 123,
        InstanceInterruptionBehavior = "instanceInterruptionBehavior",
        MaxPrice = "maxPrice",
        SpotInstanceType = "spotInstanceType",
        ValidUntil = "validUntil"
    }
};
```

Go:

```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"

instanceMarketOptionsProperty := &InstanceMarketOptionsProperty{
	MarketType: jsii.String("marketType"),
	SpotOptions: &SpotOptionsProperty{
		BlockDurationMinutes: jsii.Number(123),
		InstanceInterruptionBehavior: jsii.String("instanceInterruptionBehavior"),
		MaxPrice: jsii.String("maxPrice"),
		SpotInstanceType: jsii.String("spotInstanceType"),
		ValidUntil: jsii.String("validUntil"),
	},
}
```

## Properties

- `marketType`: string — The market type.

- `spotOptions`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnLaunchTemplate.SpotOptionsProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.CfnLaunchTemplate.SpotOptionsProperty.html) — The options for Spot Instances.
