Skip to main content

capacity_reservation_fleets

Creates, updates, deletes or gets a capacity_reservation_fleet resource or lists capacity_reservation_fleets in a region

Overview

Namecapacity_reservation_fleets
TypeResource
DescriptionResource Type definition for AWS::EC2::CapacityReservationFleet
Idaws.ec2.capacity_reservation_fleets

Fields

NameDatatypeDescription
allocation_strategystring
tag_specificationsarray
instance_type_specificationsarray
total_target_capacityinteger
end_datestring
instance_match_criteriastring
capacity_reservation_fleet_idstring
tenancystring
remove_end_dateboolean
no_remove_end_dateboolean
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all capacity_reservation_fleets in a region.

SELECT
region,
allocation_strategy,
tag_specifications,
instance_type_specifications,
total_target_capacity,
end_date,
instance_match_criteria,
capacity_reservation_fleet_id,
tenancy,
remove_end_date,
no_remove_end_date
FROM aws.ec2.capacity_reservation_fleets
WHERE region = 'us-east-1';

Gets all properties from an individual capacity_reservation_fleet.

SELECT
region,
allocation_strategy,
tag_specifications,
instance_type_specifications,
total_target_capacity,
end_date,
instance_match_criteria,
capacity_reservation_fleet_id,
tenancy,
remove_end_date,
no_remove_end_date
FROM aws.ec2.capacity_reservation_fleets
WHERE region = 'us-east-1' AND data__Identifier = '<CapacityReservationFleetId>';

INSERT example

Use the following StackQL query and manifest file to create a new capacity_reservation_fleet resource, using stack-deploy.

/*+ create */
INSERT INTO aws.ec2.capacity_reservation_fleets (
AllocationStrategy,
TagSpecifications,
InstanceTypeSpecifications,
TotalTargetCapacity,
EndDate,
InstanceMatchCriteria,
Tenancy,
RemoveEndDate,
NoRemoveEndDate,
region
)
SELECT
'{{ AllocationStrategy }}',
'{{ TagSpecifications }}',
'{{ InstanceTypeSpecifications }}',
'{{ TotalTargetCapacity }}',
'{{ EndDate }}',
'{{ InstanceMatchCriteria }}',
'{{ Tenancy }}',
'{{ RemoveEndDate }}',
'{{ NoRemoveEndDate }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ec2.capacity_reservation_fleets
WHERE data__Identifier = '<CapacityReservationFleetId>'
AND region = 'us-east-1';

Permissions

To operate on the capacity_reservation_fleets resource, the following permissions are required:

Create

ec2:CreateCapacityReservationFleet,
ec2:ModifyCapacityReservationFleet,
ec2:DescribeCapacityReservationFleets,
ec2:CancelCapacityReservationFleets,
ec2:CreateCapacityReservation,
ec2:DescribeCapacityReservations,
ec2:CancelCapacityReservation,
ec2:DescribeInstances,
ec2:CreateTags,
iam:CreateServiceLinkedRole

Delete

ec2:CreateCapacityReservationFleet,
ec2:ModifyCapacityReservationFleet,
ec2:DescribeCapacityReservationFleets,
ec2:CancelCapacityReservationFleets,
ec2:CreateCapacityReservation,
ec2:DescribeCapacityReservations,
ec2:CancelCapacityReservation,
ec2:DeleteTags

List

ec2:DescribeCapacityReservationFleets,
ec2:DescribeCapacityReservations,
ec2:DescribeInstances

Read

ec2:DescribeCapacityReservationFleets,
ec2:DescribeInstances,
ec2:DescribeCapacityReservations

Update

ec2:CreateCapacityReservationFleet,
ec2:ModifyCapacityReservationFleet,
ec2:DescribeCapacityReservationFleets,
ec2:CancelCapacityReservationFleets,
ec2:CreateCapacityReservation,
ec2:ModifyCapacityReservation,
ec2:DescribeCapacityReservations,
ec2:CancelCapacityReservation,
ec2:DescribeInstances,
ec2:DeleteTags