capacity_blocks
Creates, updates, deletes, gets or lists a capacity_blocks resource.
Overview
| Name | capacity_blocks |
| Type | Resource |
| Id | aws.ec2.capacity_blocks |
Fields
The following fields are returned by SELECT queries:
- describe_capacity_blocks
| Name | Datatype | Description |
|---|---|---|
availability_zone | string | The Availability Zone of the Capacity Block. |
availability_zone_id | string | The Availability Zone ID of the Capacity Block. |
capacity_block_id | string | The ID of the Capacity Block. |
capacity_reservation_ids | string | The ID of the Capacity Reservation. |
create_date | string | The date and time at which the Capacity Block was created. |
end_date | string | The date and time at which the Capacity Block expires. When a Capacity Block expires, all instances in the Capacity Block are terminated. |
start_date | string | The date and time at which the Capacity Block was started. |
state | string | The state of the Capacity Block. |
tags | string | The tags assigned to the Capacity Block. |
ultraserver_type | string | The EC2 UltraServer type of the Capacity Block. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_capacity_blocks | select | region | CapacityBlockId, NextToken, MaxResults, Filter, DryRun | Describes 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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
CapacityBlockId | array | The IDs of the Capacity Blocks. |
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. |
Filter | array | One 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. |
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 to use to retrieve the next page of results. |
SELECT examples
- describe_capacity_blocks
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 }}'
;