Skip to main content

capacity_reservations

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

Overview

Namecapacity_reservations
TypeResource
Idaws.athena.capacity_reservations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
allocated_dpusintegerThe number of data processing units currently allocated.
creation_timestring (date-time)The time in UTC epoch millis when the capacity reservation was created.
last_allocationobjectContains the submission time of a single allocation request for a capacity reservation and the most recent status of the attempted allocation.
last_successful_allocation_timestring (date-time)The time of the most recent capacity allocation that succeeded.
namestringThe name of the capacity reservation. (pattern: <code>[a-zA-Z0-9._-]+</code>)
statusstringThe status of the capacity reservation. (PENDING, ACTIVE, CANCELLING, CANCELLED, FAILED, UPDATE_PENDING)
target_dpusintegerThe number of data processing units requested.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_capacity_reservationselectregionReturns information about the capacity reservation with the specified name.
list_capacity_reservationsselectregionLists the capacity reservations for the current account.
create_capacity_reservationinsertregion, TargetDpus, NameCreates a capacity reservation with the specified name and number of requested data processing units.
update_capacity_reservationupdateregion, TargetDpus, NameUpdates the number of requested data processing units for the capacity reservation with the specified name.
delete_capacity_reservationdeleteregionDeletes a cancelled capacity reservation. A reservation must be cancelled before it can be deleted. A deleted reservation is immediately removed from your account and can no longer be referenced, including by its ARN. A deleted reservation cannot be called by GetCapacityReservation, and deleted reservations do not appear in the output of ListCapacityReservations.

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)

SELECT examples

Returns information about the capacity reservation with the specified name.

SELECT
allocated_dpus,
creation_time,
last_allocation,
last_successful_allocation_time,
name,
status,
target_dpus
FROM aws.athena.capacity_reservations
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a capacity reservation with the specified name and number of requested data processing units.

INSERT INTO aws.athena.capacity_reservations (
TargetDpus,
Name,
Tags,
region
)
SELECT
{{ TargetDpus }} /* required */,
'{{ Name }}' /* required */,
'{{ Tags }}',
'{{ region }}'
;

UPDATE examples

Updates the number of requested data processing units for the capacity reservation with the specified name.

UPDATE aws.athena.capacity_reservations
SET
TargetDpus = {{ TargetDpus }},
Name = '{{ Name }}'
WHERE
region = '{{ region }}' --required
AND TargetDpus = '{{ TargetDpus }}' --required
AND Name = '{{ Name }}' --required;

DELETE examples

Deletes a cancelled capacity reservation. A reservation must be cancelled before it can be deleted. A deleted reservation is immediately removed from your account and can no longer be referenced, including by its ARN. A deleted reservation cannot be called by GetCapacityReservation, and deleted reservations do not appear in the output of ListCapacityReservations.

DELETE FROM aws.athena.capacity_reservations
WHERE region = '{{ region }}' --required
;