capacity_reservations
Creates, updates, deletes, gets or lists a capacity_reservations resource.
Overview
| Name | capacity_reservations |
| Type | Resource |
| Id | aws.athena.capacity_reservations |
Fields
The following fields are returned by SELECT queries:
- get_capacity_reservation
- list_capacity_reservations
| Name | Datatype | Description |
|---|---|---|
allocated_dpus | integer | The number of data processing units currently allocated. |
creation_time | string (date-time) | The time in UTC epoch millis when the capacity reservation was created. |
last_allocation | object | Contains the submission time of a single allocation request for a capacity reservation and the most recent status of the attempted allocation. |
last_successful_allocation_time | string (date-time) | The time of the most recent capacity allocation that succeeded. |
name | string | The name of the capacity reservation. (pattern: <code>[a-zA-Z0-9._-]+</code>) |
status | string | The status of the capacity reservation. (PENDING, ACTIVE, CANCELLING, CANCELLED, FAILED, UPDATE_PENDING) |
target_dpus | integer | The number of data processing units requested. |
| Name | Datatype | Description |
|---|---|---|
capacity_reservations | array | The capacity reservations for the current account. |
next_token | string | A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_capacity_reservation | select | region | Returns information about the capacity reservation with the specified name. | |
list_capacity_reservations | select | region | Lists the capacity reservations for the current account. | |
create_capacity_reservation | insert | region, TargetDpus, Name | Creates a capacity reservation with the specified name and number of requested data processing units. | |
update_capacity_reservation | update | region, TargetDpus, Name | Updates the number of requested data processing units for the capacity reservation with the specified name. | |
delete_capacity_reservation | delete | region | 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. |
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) |
SELECT examples
- get_capacity_reservation
- list_capacity_reservations
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
;
Lists the capacity reservations for the current account.
SELECT
capacity_reservations,
next_token
FROM aws.athena.capacity_reservations
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_capacity_reservation
- Manifest
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 }}'
;
# Description fields are for documentation purposes
- name: capacity_reservations
props:
- name: region
value: "{{ region }}"
description: Required parameter for the capacity_reservations resource.
- name: TargetDpus
value: {{ TargetDpus }}
description: |
The number of requested data processing units.
- name: Name
value: "{{ Name }}"
description: |
The name of the capacity reservation to create.
- name: Tags
description: |
The tags for the capacity reservation.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
UPDATE examples
- update_capacity_reservation
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
- delete_capacity_reservation
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
;