> For the complete documentation index, see [llms.txt](https://docs.skeddly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.skeddly.com/data-types/actionparameters-object/amazonrequestec2spotinstancesparameters-object.md).

# AmazonRequestEc2SpotInstancesParameters Object

## Description

Parameters for the Amazon Request EC2 Spot Instances action.

## Properties

### availabilityZone

Availability zone in which to launch the requested EC2 instances.

Type: `string`

Required: No

### cancelTimeInSeconds

Time (in seconds) after the request is made when it will be cancelled.

Type: `integer`

Required: No

### credentialIds

Registered credentials to use with the action. One and only one credential must be specified.

Type: Array of `string`

Required: Yes

### elasticIp

Elastic IP address to assign to the launched EC2 instance. If more than one EC2 instance is launched, only one will receive the elastic IP address.

Type: `string`

Required: No

### iamInstanceProfile

IAM instance profile to assign to the launched EC2 instances.

Type: `string`

Required: No

### imageDescriptionComparison

Comparison to use when identifying images by description. Required when `imageIdentificationMethod` is `by-image-description`.

Type: [AmiImageDescriptionComparison](/data-types/amiimagedescriptioncomparison-object.md) object.

Required: Conditional

### imageId

Image ID of the AMI image to use for the spot instance request. Required when `imageIdentificationMethod` is `by-image-id`.

Type: `string`

Required: Conditional

### imageIdentificationMethod

Method of identifying the AMI image to use.

Type: `string`

Valid Values:

* `all-images`
* `by-image-id`
* `by-image-name`
* `by-image-description`
* `by-image-name-tag`
* `by-resource-tag`

Required: Yes

### imageNameComparison

Comparison to use when identifying images by name. Required when `imageIdentificationMethod` is `by-image-name`.

Type: [AmiImageNameComparison](/data-types/amiimagenamecomparison-object.md) object.

Required: Conditional

### instanceType

EC2 Instance type to use with the request.

Type: `string`

Required: Yes

### keyPair

Name of the key pair to assign to the EC2 instances.

Type: `string`

Required: No

### maxInstanceCount

Maximum number of instances to request.

Type: `integer`

Required: Yes

### maxSpotPriceUsd

Maximum spot price to use for the request.

Type: `decimal`

Required: Yes

### nameTagComparison

Comparison to use when identifying images by the `Name` tag. Required when `imageIdentificationMethod` is `by-image-name-tag`.

Type: [NameTagComparison](/data-types/nametagcomparison-object.md) object.

Required: Conditional

### regionNames

Region to use with the action. One and only one region must be specified.

Type: Array of `string`

Required: Yes

### resourceTagComparison

Comparison to use when identifying images by resource tag. Required when `imageIdentificationMethod` is `by-resource-tag`.

Type: [ResourceTagComparison](/data-types/resourcetagcomparison-object-1.md) object.

Required: Conditional

### securityGroup

Security group to attach to the EC2 instances.

Type: `string`

Required: No

### terminateTimeFrame

Time frame determining when the EC2 instances will be terminated. Required when `terminateTimeInSeconds` is set.

Type: `string`

Valid Values:

* `from-action-start`
* `from-instance-launch`

Required: Conditional

### terminateTimeInSeconds

Time (in seconds) after which the EC2 instances will be terminated.

Type: `integer`

Required: No

### userData

User data which will be used by the EC2 instances.

Type: `string`

Required: No

### userDataFormat

Format of the text in the `UserData` field. Required when `UserData` is specified.

Type: `string`

Valid Values:

* `text`
* `base64-encoded`

Required: Conditional

### vpcSubnetId

ID of the VPC subnet in which the EC2 instances should be launched.

Type: `string`

Required: No

## Sample JSON

```javascript
{
    "credentialIds": [
        "cred-00000001"
    ],
    "regionNames": [
        "us-east-1"
    ],

    "ImageIdentificationMethod": "by-image-name",
    "ImageNameComparison": {
        "compareType": "starts-with",
        "imageName": "prod-"
    },

    "MaxSpotPriceUsd": 0.25,
    "MaxInstanceCount": 1,

    "InstanceType": "t2.micro",
    "vpcSubnetId": "subnet-00000000",

    "cancelTimeInSeconds": 300,
    "terminateTimeInSeconds": 300,
    "TerminateTimeFrame": "from-instance-launch"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.skeddly.com/data-types/actionparameters-object/amazonrequestec2spotinstancesparameters-object.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
