Skip to main content

host_reservations

Creates, updates, deletes, gets or lists a host_reservations resource.

Overview

Namehost_reservations
TypeResource
Idaws.ec2.host_reservations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
countintegerThe number of Dedicated Hosts the reservation is associated with.
currency_codestringThe currency in which the upfrontPrice and hourlyPrice amounts are specified. At this time, the only supported currency is USD.
durationintegerThe length of the reservation's term, specified in seconds. Can be 31536000 (1 year) | 94608000 (3 years).
endstringThe date and time that the reservation ends.
host_id_setstringThe IDs of the Dedicated Hosts associated with the reservation.
host_reservation_idstringThe ID of the reservation that specifies the associated Dedicated Hosts.
hourly_pricestringThe hourly price of the reservation.
instance_familystringThe instance family of the Dedicated Host Reservation. The instance family on the Dedicated Host must be the same in order for it to benefit from the reservation.
offering_idstringThe ID of the reservation. This remains the same regardless of which Dedicated Hosts are associated with it.
payment_optionstringThe payment option selected for this reservation.
startstringThe date and time that the reservation started.
statestringThe state of the reservation.
tagsstringAny tags assigned to the Dedicated Host Reservation.
upfront_pricestringThe upfront price of the reservation.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_host_reservationsselectregionFilter, HostReservationIdSet, MaxResults, NextTokenDescribes reservations that are associated with Dedicated Hosts in your account.

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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
FilterarrayThe filters. instance-family - The instance family (for example, m4). payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront). state - The state of the reservation (payment-pending | payment-failed | active | retired). tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value. tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.
HostReservationIdSetarrayThe host reservation IDs.
MaxResultsintegerThe maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned nextToken value. This value can be between 5 and 500. If maxResults is given a larger value than 500, you receive an error.
NextTokenstringThe token to use to retrieve the next page of results.

SELECT examples

Describes reservations that are associated with Dedicated Hosts in your account.

SELECT
count,
currency_code,
duration,
end,
host_id_set,
host_reservation_id,
hourly_price,
instance_family,
offering_id,
payment_option,
start,
state,
tags,
upfront_price
FROM aws.ec2.host_reservations
WHERE region = '{{ region }}' -- required
AND Filter = '{{ Filter }}'
AND HostReservationIdSet = '{{ HostReservationIdSet }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;