Skip to main content

capacity_reservation_fleets

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

Overview

Namecapacity_reservation_fleets
TypeResource
Idaws.ec2.capacity_reservation_fleets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
allocation_strategystringThe 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_arnstringThe ARN of the Capacity Reservation Fleet.
capacity_reservation_fleet_idstringThe ID of the Capacity Reservation Fleet.
create_timestringThe date and time at which the Capacity Reservation Fleet was created.
end_datestringThe date and time at which the Capacity Reservation Fleet expires.
instance_match_criteriastringIndicates 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_specificationsstringInformation about the instance types for which to reserve the capacity.
statestringThe 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.
tagsstringThe tags assigned to the Capacity Reservation Fleet.
tenancystringThe 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_capacitynumberThe capacity units that have been fulfilled.
total_target_capacityintegerThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_capacity_reservation_fleetsselectregionCapacityReservationFleetId, NextToken, MaxResults, Filter, DryRunDescribes one or more Capacity Reservation Fleets.
create_capacity_reservation_fleetinsertTotalTargetCapacity, regionAllocationStrategy, ClientToken, InstanceTypeSpecification, Tenancy, EndDate, InstanceMatchCriteria, TagSpecification, DryRunCreates a Capacity Reservation Fleet. For more information, see Create a Capacity Reservation Fleet in the Amazon EC2 User Guide.
modify_capacity_reservation_fleetupdateCapacityReservationFleetId, regionTotalTargetCapacity, EndDate, DryRun, RemoveEndDateModifies 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_fleetsexecCapacityReservationFleetId, regionDryRunCancels 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.

NameDatatypeDescription
CapacityReservationFleetIdarrayThe IDs of the Capacity Reservation Fleets to cancel.
TotalTargetCapacityintegerThe 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.
regionstringAWS region (default: us-east-1)
AllocationStrategystringThe 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
CapacityReservationFleetIdarrayThe IDs of the Capacity Reservation Fleets to describe.
ClientTokenstringUnique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see Ensure Idempotency.
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.
EndDatestring (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.
FilterarrayOne 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.
InstanceMatchCriteriastringIndicates 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.
InstanceTypeSpecificationarrayInformation about the instance types for which to reserve the capacity.
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.
RemoveEndDatebooleanIndicates 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.
TagSpecificationarrayThe tags to assign to the Capacity Reservation Fleet. The tags are automatically assigned to the Capacity Reservations in the Fleet.
TenancystringIndicates 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.
TotalTargetCapacityintegerThe 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

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

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
;

UPDATE examples

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

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 }}
;