Skip to main content

capacity_blocks

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

Overview

Namecapacity_blocks
TypeResource
Idaws.ec2.capacity_blocks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
availability_zonestringThe Availability Zone of the Capacity Block.
availability_zone_idstringThe Availability Zone ID of the Capacity Block.
capacity_block_idstringThe ID of the Capacity Block.
capacity_reservation_idsstringThe ID of the Capacity Reservation.
create_datestringThe date and time at which the Capacity Block was created.
end_datestringThe date and time at which the Capacity Block expires. When a Capacity Block expires, all instances in the Capacity Block are terminated.
start_datestringThe date and time at which the Capacity Block was started.
statestringThe state of the Capacity Block.
tagsstringThe tags assigned to the Capacity Block.
ultraserver_typestringThe EC2 UltraServer type of the Capacity Block.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_capacity_blocksselectregionCapacityBlockId, NextToken, MaxResults, Filter, DryRunDescribes details about Capacity Blocks in the Amazon Web Services Region that you're currently using.

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)
CapacityBlockIdarrayThe IDs of the Capacity Blocks.
DryRunbooleanChecks 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.
FilterarrayOne or more filters. capacity-block-id - The ID of the Capacity Block. ultraserver-type - The Capacity Block type. The type can be instances or ultraservers. availability-zone - The Availability Zone of the Capacity Block. start-date - The date and time at which the Capacity Block was started. end-date - The date and time at which the Capacity Block expires. When a Capacity Block expires, all instances in the Capacity Block are terminated. create-date - The date and time at which the Capacity Block was created. state - The state of the Capacity Block (active | expired | unavailable | cancelled | failed | scheduled | payment-pending | payment-failed). tags - The tags assigned to the Capacity Block.
MaxResultsintegerThe 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.
NextTokenstringThe token to use to retrieve the next page of results.

SELECT examples

Describes details about Capacity Blocks in the Amazon Web Services Region that you're currently using.

SELECT
availability_zone,
availability_zone_id,
capacity_block_id,
capacity_reservation_ids,
create_date,
end_date,
start_date,
state,
tags,
ultraserver_type
FROM aws.ec2.capacity_blocks
WHERE region = '{{ region }}' -- required
AND CapacityBlockId = '{{ CapacityBlockId }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
AND Filter = '{{ Filter }}'
AND DryRun = '{{ DryRun }}'
;