capacity_reservation_fleets
Creates, updates, deletes, gets or lists a capacity_reservation_fleets resource.
Overview
| Name | capacity_reservation_fleets |
| Type | Resource |
| Id | aws.ec2.capacity_reservation_fleets |
Fields
The following fields are returned by SELECT queries:
- describe_capacity_reservation_fleets
| Name | Datatype | Description |
|---|---|---|
allocation_strategy | string | The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use. For more information, see For more information, see Allocation strategy in the Amazon EC2 User Guide. |
capacity_reservation_fleet_arn | string | The ARN of the Capacity Reservation Fleet. |
capacity_reservation_fleet_id | string | The ID of the Capacity Reservation Fleet. |
create_time | string | The date and time at which the Capacity Reservation Fleet was created. |
end_date | string | The date and time at which the Capacity Reservation Fleet expires. |
instance_match_criteria | string | Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in the Fleet inherit this instance matching criteria. Currently, Capacity Reservation Fleets support open instance matching criteria only. This means that instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its reserved capacity. |
instance_type_specifications | string | Information about the instance types for which to reserve the capacity. |
state | string | The state of the Capacity Reservation Fleet. Possible states include: submitted - The Capacity Reservation Fleet request has been submitted and Amazon Elastic Compute Cloud is preparing to create the Capacity Reservations. modifying - The Capacity Reservation Fleet is being modified. The Fleet remains in this state until the modification is complete. active - The Capacity Reservation Fleet has fulfilled its total target capacity and it is attempting to maintain this capacity. The Fleet remains in this state until it is modified or deleted. partially_fulfilled - The Capacity Reservation Fleet has partially fulfilled its total target capacity. There is insufficient Amazon EC2 to fulfill the total target capacity. The Fleet is attempting to asynchronously fulfill its total target capacity. expiring - The Capacity Reservation Fleet has reach its end date and it is in the process of expiring. One or more of its Capacity reservations might still be active. expired - The Capacity Reservation Fleet has reach its end date. The Fleet and its Capacity Reservations are expired. The Fleet can't create new Capacity Reservations. cancelling - The Capacity Reservation Fleet is in the process of being cancelled. One or more of its Capacity reservations might still be active. cancelled - The Capacity Reservation Fleet has been manually cancelled. The Fleet and its Capacity Reservations are cancelled and the Fleet can't create new Capacity Reservations. failed - The Capacity Reservation Fleet failed to reserve capacity for the specified instance types. |
tags | string | The tags assigned to the Capacity Reservation Fleet. |
tenancy | string | The tenancy of the Capacity Reservation Fleet. Tenancies include: default - The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web Services accounts. dedicated - The Capacity Reservation Fleet is created on single-tenant hardware that is dedicated to a single Amazon Web Services account. |
total_fulfilled_capacity | number | The capacity units that have been fulfilled. |
total_target_capacity | integer | The total number of capacity units for which the Capacity Reservation Fleet reserves capacity. For more information, see Total target capacity in the Amazon EC2 User Guide. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_capacity_reservation_fleets | select | region | CapacityReservationFleetId, NextToken, MaxResults, Filter, DryRun | Describes one or more Capacity Reservation Fleets. |
create_capacity_reservation_fleet | insert | TotalTargetCapacity, region | AllocationStrategy, ClientToken, InstanceTypeSpecification, Tenancy, EndDate, InstanceMatchCriteria, TagSpecification, DryRun | Creates a Capacity Reservation Fleet. For more information, see Create a Capacity Reservation Fleet in the Amazon EC2 User Guide. |
modify_capacity_reservation_fleet | update | CapacityReservationFleetId, region | TotalTargetCapacity, EndDate, DryRun, RemoveEndDate | Modifies a Capacity Reservation Fleet. When you modify the total target capacity of a Capacity Reservation Fleet, the Fleet automatically creates new Capacity Reservations, or modifies or cancels existing Capacity Reservations in the Fleet to meet the new total target capacity. When you modify the end date for the Fleet, the end dates for all of the individual Capacity Reservations in the Fleet are updated accordingly. |
cancel_capacity_reservation_fleets | exec | CapacityReservationFleetId, region | DryRun | Cancels one or more Capacity Reservation Fleets. When you cancel a Capacity Reservation Fleet, the following happens: The Capacity Reservation Fleet's status changes to cancelled. The individual Capacity Reservations in the Fleet are cancelled. Instances running in the Capacity Reservations at the time of cancelling the Fleet continue to run in shared capacity. The Fleet stops creating new Capacity Reservations. |
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 |
|---|---|---|
CapacityReservationFleetId | array | The IDs of the Capacity Reservation Fleets to cancel. |
TotalTargetCapacity | integer | The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with the instance type weights that you assign to each instance type used by the Fleet determine the number of instances for which the Fleet reserves capacity. Both values are based on units that make sense for your workload. For more information, see Total target capacity in the Amazon EC2 User Guide. |
region | string | AWS region (default: us-east-1) |
AllocationStrategy | string | The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use. Currently, only the prioritized allocation strategy is supported. For more information, see Allocation strategy in the Amazon EC2 User Guide. Valid values: prioritized |
CapacityReservationFleetId | array | The IDs of the Capacity Reservation Fleets to describe. |
ClientToken | string | Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency. |
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. |
EndDate | string (date-time) | The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires, its state changes to expired and all of the Capacity Reservations in the Fleet expire. The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation Fleet is guaranteed to expire between 13:30:55 and 14:30:55 on 5/31/2019. You can't specify EndDate and RemoveEndDate in the same request. |
Filter | array | One or more filters. state - The state of the Fleet (submitted | modifying | active | partially_fulfilled | expiring | expired | cancelling | cancelled | failed). instance-match-criteria - The instance matching criteria for the Fleet. Only open is supported. tenancy - The tenancy of the Fleet (default | dedicated). allocation-strategy - The allocation strategy used by the Fleet. Only prioritized is supported. |
InstanceMatchCriteria | string | Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in the Fleet inherit this instance matching criteria. Currently, Capacity Reservation Fleets support open instance matching criteria only. This means that instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its reserved capacity. |
InstanceTypeSpecification | array | Information about the instance types for which to reserve the 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. |
RemoveEndDate | boolean | Indicates whether to remove the end date from the Capacity Reservation Fleet. If you remove the end date, the Capacity Reservation Fleet does not expire and it remains active until you explicitly cancel it using the CancelCapacityReservationFleet action. You can't specify RemoveEndDate and EndDate in the same request. |
TagSpecification | array | The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet. |
Tenancy | string | Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings: default - The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web Services accounts. dedicated - The Capacity Reservations are created on single-tenant hardware that is dedicated to a single Amazon Web Services account. |
TotalTargetCapacity | integer | The total number of capacity units to be reserved by the Capacity Reservation Fleet. This value, together with the instance type weights that you assign to each instance type used by the Fleet determine the number of instances for which the Fleet reserves capacity. Both values are based on units that make sense for your workload. For more information, see Total target capacity in the Amazon EC2 User Guide. |
SELECT examples
- describe_capacity_reservation_fleets
Describes one or more Capacity Reservation Fleets.
SELECT
allocation_strategy,
capacity_reservation_fleet_arn,
capacity_reservation_fleet_id,
create_time,
end_date,
instance_match_criteria,
instance_type_specifications,
state,
tags,
tenancy,
total_fulfilled_capacity,
total_target_capacity
FROM aws.ec2.capacity_reservation_fleets
WHERE region = '{{ region }}' -- required
AND CapacityReservationFleetId = '{{ CapacityReservationFleetId }}'
AND NextToken = '{{ NextToken }}'
AND MaxResults = '{{ MaxResults }}'
AND Filter = '{{ Filter }}'
AND DryRun = '{{ DryRun }}'
;
INSERT examples
- create_capacity_reservation_fleet
- Manifest
Creates a Capacity Reservation Fleet. For more information, see Create a Capacity Reservation Fleet in the Amazon EC2 User Guide.
INSERT INTO aws.ec2.capacity_reservation_fleets (
TotalTargetCapacity,
region,
AllocationStrategy,
ClientToken,
InstanceTypeSpecification,
Tenancy,
EndDate,
InstanceMatchCriteria,
TagSpecification,
DryRun
)
SELECT
'{{ TotalTargetCapacity }}',
'{{ region }}',
'{{ AllocationStrategy }}',
'{{ ClientToken }}',
'{{ InstanceTypeSpecification }}',
'{{ Tenancy }}',
'{{ EndDate }}',
'{{ InstanceMatchCriteria }}',
'{{ TagSpecification }}',
'{{ DryRun }}'
RETURNING
allocation_strategy,
capacity_reservation_fleet_id,
create_time,
end_date,
fleet_capacity_reservations,
instance_match_criteria,
state,
tags,
tenancy,
total_fulfilled_capacity,
total_target_capacity
;
# Description fields are for documentation purposes
- name: capacity_reservation_fleets
props:
- name: TotalTargetCapacity
value: {{ TotalTargetCapacity }}
description: Required parameter for the capacity_reservation_fleets resource.
- name: region
value: "{{ region }}"
description: Required parameter for the capacity_reservation_fleets resource.
- name: AllocationStrategy
value: "{{ AllocationStrategy }}"
description: The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use. Currently, only the prioritized allocation strategy is supported. For more information, see Allocation strategy in the Amazon EC2 User Guide. Valid values: prioritized
description: The strategy used by the Capacity Reservation Fleet to determine which of the specified instance types to use. Currently, only the prioritized allocation strategy is supported. For more information, see Allocation strategy in the Amazon EC2 User Guide. Valid values: prioritized
- name: ClientToken
value: "{{ ClientToken }}"
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
description: Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
- name: InstanceTypeSpecification
value: "{{ InstanceTypeSpecification }}"
description: Information about the instance types for which to reserve the capacity.
description: Information about the instance types for which to reserve the capacity.
- name: Tenancy
value: "{{ Tenancy }}"
description: Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings: default - The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web Services accounts. dedicated - The Capacity Reservations are created on single-tenant hardware that is dedicated to a single Amazon Web Services account.
description: Indicates the tenancy of the Capacity Reservation Fleet. All Capacity Reservations in the Fleet inherit this tenancy. The Capacity Reservation Fleet can have one of the following tenancy settings: default - The Capacity Reservation Fleet is created on hardware that is shared with other Amazon Web Services accounts. dedicated - The Capacity Reservations are created on single-tenant hardware that is dedicated to a single Amazon Web Services account.
- name: EndDate
value: "{{ EndDate }}"
description: The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires, its state changes to expired and all of the Capacity Reservations in the Fleet expire. The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation Fleet is guaranteed to expire between 13:30:55 and 14:30:55 on 5/31/2019.
description: The date and time at which the Capacity Reservation Fleet expires. When the Capacity Reservation Fleet expires, its state changes to expired and all of the Capacity Reservations in the Fleet expire. The Capacity Reservation Fleet expires within an hour after the specified time. For example, if you specify 5/31/2019, 13:30:55, the Capacity Reservation Fleet is guaranteed to expire between 13:30:55 and 14:30:55 on 5/31/2019.
- name: InstanceMatchCriteria
value: "{{ InstanceMatchCriteria }}"
description: Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in the Fleet inherit this instance matching criteria. Currently, Capacity Reservation Fleets support open instance matching criteria only. This means that instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its reserved capacity.
description: Indicates the type of instance launches that the Capacity Reservation Fleet accepts. All Capacity Reservations in the Fleet inherit this instance matching criteria. Currently, Capacity Reservation Fleets support open instance matching criteria only. This means that instances that have matching attributes (instance type, platform, and Availability Zone) run in the Capacity Reservations automatically. Instances do not need to explicitly target a Capacity Reservation Fleet to use its reserved capacity.
- name: TagSpecification
value: "{{ TagSpecification }}"
description: The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
description: The tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
- name: DryRun
value: {{ DryRun }}
description: 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.
description: 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.
UPDATE examples
- modify_capacity_reservation_fleet
Modifies a Capacity Reservation Fleet. When you modify the total target capacity of a Capacity Reservation Fleet, the Fleet automatically creates new Capacity Reservations, or modifies or cancels existing Capacity Reservations in the Fleet to meet the new total target capacity. When you modify the end date for the Fleet, the end dates for all of the individual Capacity Reservations in the Fleet are updated accordingly.
UPDATE aws.ec2.capacity_reservation_fleets
SET
-- No updatable properties
WHERE
CapacityReservationFleetId = '{{ CapacityReservationFleetId }}' --required
AND region = '{{ region }}' --required
AND TotalTargetCapacity = '{{ TotalTargetCapacity}}'
AND EndDate = '{{ EndDate}}'
AND DryRun = {{ DryRun}}
AND RemoveEndDate = {{ RemoveEndDate}}
RETURNING
return;
Lifecycle Methods
- cancel_capacity_reservation_fleets
Cancels one or more Capacity Reservation Fleets. When you cancel a Capacity Reservation Fleet, the following happens: The Capacity Reservation Fleet's status changes to cancelled. The individual Capacity Reservations in the Fleet are cancelled. Instances running in the Capacity Reservations at the time of cancelling the Fleet continue to run in shared capacity. The Fleet stops creating new Capacity Reservations.
EXEC aws.ec2.capacity_reservation_fleets.cancel_capacity_reservation_fleets
@CapacityReservationFleetId='{{ CapacityReservationFleetId }}' --required,
@region='{{ region }}' --required,
@DryRun={{ DryRun }}
;