spot_price_histories
Creates, updates, deletes, gets or lists a spot_price_histories resource.
Overview
| Name | spot_price_histories |
| Type | Resource |
| Id | aws.ec2.spot_price_histories |
Fields
The following fields are returned by SELECT queries:
- describe_spot_price_history
| Name | Datatype | Description |
|---|---|---|
availability_zone | string | The Availability Zone. |
availability_zone_id | string | The ID of the Availability Zone. |
instance_type | string | The instance type. |
product_description | string | A general description of the AMI. |
spot_price | string | The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price. If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter. |
timestamp | string | The date and time the request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_spot_price_history | select | region | AvailabilityZoneId, DryRun, StartTime, EndTime, InstanceType, ProductDescription, Filter, AvailabilityZone, MaxResults, NextToken | Describes the Spot price history. For more information, see Spot Instance pricing history in the Amazon EC2 User Guide. When you specify a start and end time, the operation returns the prices of the instance types within that time range. It also returns the last price change before the start time, which is the effective price as of the start time. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
AvailabilityZone | string | Filters the results by the specified Availability Zone. Either AvailabilityZone or AvailabilityZoneId can be specified, but not both |
AvailabilityZoneId | string | Filters the results by the specified ID of the Availability Zone. Either AvailabilityZone or AvailabilityZoneId can be specified, but not both |
DryRun | boolean | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. |
EndTime | string (date-time) | The date and time, up to the current date, from which to stop retrieving the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). |
Filter | array | The filters. availability-zone - The Availability Zone for which prices should be returned. availability-zone-id - The ID of the Availability Zone for which prices should be returned. instance-type - The type of instance (for example, m3.medium). product-description - The product description for the Spot price (Linux/UNIX | Red Hat Enterprise Linux | SUSE Linux | Windows | Linux/UNIX (Amazon VPC) | Red Hat Enterprise Linux (Amazon VPC) | SUSE Linux (Amazon VPC) | Windows (Amazon VPC)). spot-price - The Spot price. The value must match exactly (or use wildcards; greater than or less than comparison is not supported). timestamp - The time stamp of the Spot price history, in UTC format (for example, ddd MMM dd HH:mm:ss UTC YYYY). You can use wildcards (* and ?). Greater than or less than comparison is not supported. |
InstanceType | array | Filters the results by the specified instance types. |
MaxResults | integer | The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination. |
NextToken | string | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
ProductDescription | array | Filters the results by the specified basic product descriptions. |
StartTime | string (date-time) | The date and time, up to the past 90 days, from which to start retrieving the price history data, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). |
SELECT examples
- describe_spot_price_history
Describes the Spot price history. For more information, see Spot Instance pricing history in the Amazon EC2 User Guide. When you specify a start and end time, the operation returns the prices of the instance types within that time range. It also returns the last price change before the start time, which is the effective price as of the start time.
SELECT
availability_zone,
availability_zone_id,
instance_type,
product_description,
spot_price,
timestamp
FROM aws.ec2.spot_price_histories
WHERE region = '{{ region }}' -- required
AND AvailabilityZoneId = '{{ AvailabilityZoneId }}'
AND DryRun = '{{ DryRun }}'
AND StartTime = '{{ StartTime }}'
AND EndTime = '{{ EndTime }}'
AND InstanceType = '{{ InstanceType }}'
AND ProductDescription = '{{ ProductDescription }}'
AND Filter = '{{ Filter }}'
AND AvailabilityZone = '{{ AvailabilityZone }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;