capacity_block_offerings
Creates, updates, deletes, gets or lists a capacity_block_offerings resource.
Overview
| Name | capacity_block_offerings |
| Type | Resource |
| Id | aws.ec2.capacity_block_offerings |
Fields
The following fields are returned by SELECT queries:
- describe_capacity_block_offerings
| Name | Datatype | Description |
|---|---|---|
availability_zone | string | The Availability Zone of the Capacity Block offering. |
capacity_block_duration_hours | integer | The number of hours (in addition to capacityBlockDurationMinutes) for the duration of the Capacity Block reservation. For example, if a Capacity Block starts at 04:55 and ends at 11:30, the hours field would be 6. |
capacity_block_duration_minutes | integer | The number of minutes (in addition to capacityBlockDurationHours) for the duration of the Capacity Block reservation. For example, if a Capacity Block starts at 08:55 and ends at 11:30, the minutes field would be 35. |
capacity_block_offering_id | string | The ID of the Capacity Block offering. |
currency_code | string | The currency of the payment for the Capacity Block. |
end_date | string | The end date of the Capacity Block offering. |
instance_count | integer | The number of instances in the Capacity Block offering. |
instance_type | string | The instance type of the Capacity Block offering. |
start_date | string | The start date of the Capacity Block offering. |
tenancy | string | The tenancy of the Capacity Block. |
ultraserver_count | integer | The number of EC2 UltraServers in the offering. |
ultraserver_type | string | The EC2 UltraServer type of the Capacity Block offering. |
upfront_fee | string | The total price to be paid up front. |
zone_type | string | The type of zone where the Capacity Block offering is available. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_capacity_block_offerings | select | CapacityDurationHours, region | DryRun, InstanceType, InstanceCount, StartDateRange, EndDateRange, NextToken, MaxResults, UltraserverType, UltraserverCount, AllAvailabilityZones | Describes Capacity Block offerings available for purchase in the Amazon Web Services Region that you're currently using. With Capacity Blocks, you can purchase a specific GPU instance type or EC2 UltraServer for a period of time. To search for an available Capacity Block offering, you specify a reservation duration and instance count. |
purchase_capacity_block | exec | CapacityBlockOfferingId, InstancePlatform, region | DryRun, TagSpecification | Purchase the Capacity Block for use with your account. With Capacity Blocks you ensure GPU capacity is available for machine learning (ML) workloads. You must specify the ID of the Capacity Block offering you are purchasing. |
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 |
|---|---|---|
CapacityBlockOfferingId | string | The ID of the Capacity Block offering. |
CapacityDurationHours | integer | The reservation duration for the Capacity Block, in hours. You must specify the duration in 1-day increments up 14 days, and in 7-day increments up to 182 days. |
InstancePlatform | string | The type of operating system for which to reserve capacity. |
region | string | AWS region (default: us-east-1) |
AllAvailabilityZones | boolean | Include all Availability Zones and Local Zones, regardless of your opt-in status. If you do not use this parameter, the results include available offerings from all Availability Zones in the Amazon Web Services Region and Local Zones you are opted into. |
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. |
EndDateRange | string (date-time) | The latest end date for the Capacity Block offering. |
InstanceCount | integer | The number of instances for which to reserve capacity. Each Capacity Block can have up to 64 instances, and you can have up to 256 instances across Capacity Blocks. |
InstanceType | string | The type of instance for which the Capacity Block offering reserves capacity. |
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. |
StartDateRange | string (date-time) | The earliest start date for the Capacity Block offering. |
TagSpecification | array | The tags to apply to the Capacity Block during launch. |
UltraserverCount | integer | The number of EC2 UltraServers in the offerings. |
UltraserverType | string | The EC2 UltraServer type of the Capacity Block offerings. |
SELECT examples
- describe_capacity_block_offerings
Describes Capacity Block offerings available for purchase in the Amazon Web Services Region that you're currently using. With Capacity Blocks, you can purchase a specific GPU instance type or EC2 UltraServer for a period of time. To search for an available Capacity Block offering, you specify a reservation duration and instance count.
SELECT
availability_zone,
capacity_block_duration_hours,
capacity_block_duration_minutes,
capacity_block_offering_id,
currency_code,
end_date,
instance_count,
instance_type,
start_date,
tenancy,
ultraserver_count,
ultraserver_type,
upfront_fee,
zone_type
FROM aws.ec2.capacity_block_offerings
WHERE CapacityDurationHours = '{{ CapacityDurationHours }}' -- required
AND region = '{{ region }}' -- required
AND DryRun = '{{ DryRun }}'
AND InstanceType = '{{ InstanceType }}'
AND InstanceCount = '{{ InstanceCount }}'
AND StartDateRange = '{{ StartDateRange }}'
AND EndDateRange = '{{ EndDateRange }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
AND UltraserverType = '{{ UltraserverType }}'
AND UltraserverCount = '{{ UltraserverCount }}'
AND AllAvailabilityZones = '{{ AllAvailabilityZones }}'
;
Lifecycle Methods
- purchase_capacity_block
Purchase the Capacity Block for use with your account. With Capacity Blocks you ensure GPU capacity is available for machine learning (ML) workloads. You must specify the ID of the Capacity Block offering you are purchasing.
EXEC aws.ec2.capacity_block_offerings.purchase_capacity_block
@CapacityBlockOfferingId='{{ CapacityBlockOfferingId }}' --required,
@InstancePlatform='{{ InstancePlatform }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }},
@TagSpecification='{{ TagSpecification }}'
;