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
Idawscc.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.

For more information, see AWS::EC2::CapacityReservationFleet.

Methods

NameResourceAccessible byRequired Params
create_resourcecapacity_reservation_fleetsINSERTregion
delete_resourcecapacity_reservation_fleetsDELETEIdentifier, region
update_resourcecapacity_reservation_fleetsUPDATEIdentifier, PatchDocument, region
list_resourcescapacity_reservation_fleets_list_onlySELECTregion
get_resourcecapacity_reservation_fleetsSELECTIdentifier, region

SELECT examples

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 awscc.ec2.capacity_reservation_fleets
WHERE
region = '{{ region }}' AND
Identifier = '{{ capacity_reservation_fleet_id }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.ec2.capacity_reservation_fleets (
AllocationStrategy,
TagSpecifications,
InstanceTypeSpecifications,
TotalTargetCapacity,
EndDate,
InstanceMatchCriteria,
Tenancy,
RemoveEndDate,
NoRemoveEndDate,
region
)
SELECT
'{{ allocation_strategy }}',
'{{ tag_specifications }}',
'{{ instance_type_specifications }}',
'{{ total_target_capacity }}',
'{{ end_date }}',
'{{ instance_match_criteria }}',
'{{ tenancy }}',
'{{ remove_end_date }}',
'{{ no_remove_end_date }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

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

/*+ update */
UPDATE awscc.ec2.capacity_reservation_fleets
SET PatchDocument = string('{{ {
"TotalTargetCapacity": total_target_capacity,
"RemoveEndDate": remove_end_date,
"NoRemoveEndDate": no_remove_end_date
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ capacity_reservation_fleet_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.capacity_reservation_fleets
WHERE
Identifier = '{{ capacity_reservation_fleet_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

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