capacity_reservation_fleets
Creates, updates, deletes or gets a capacity_reservation_fleet resource or lists capacity_reservation_fleets in a region
Overview
| Name | capacity_reservation_fleets |
| Type | Resource |
| Description | Resource Type definition for AWS::EC2::CapacityReservationFleet |
| Id | awscc.ec2.capacity_reservation_fleets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
allocation_strategy | string | |
tag_specifications | array | |
instance_type_specifications | array | |
total_target_capacity | integer | |
end_date | string | |
instance_match_criteria | string | |
capacity_reservation_fleet_id | string | |
tenancy | string | |
remove_end_date | boolean | |
no_remove_end_date | boolean | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
capacity_reservation_fleet_id | string | |
region | string | AWS region. |
For more information, see AWS::EC2::CapacityReservationFleet.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | capacity_reservation_fleets | INSERT | region |
delete_resource | capacity_reservation_fleets | DELETE | Identifier, region |
update_resource | capacity_reservation_fleets | UPDATE | Identifier, PatchDocument, region |
list_resources | capacity_reservation_fleets_list_only | SELECT | region |
get_resource | capacity_reservation_fleets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all capacity_reservation_fleets in a region.
SELECT
region,
capacity_reservation_fleet_id
FROM awscc.ec2.capacity_reservation_fleets_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new capacity_reservation_fleet resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ 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
;
/*+ 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
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: capacity_reservation_fleet
props:
- name: allocation_strategy
value: '{{ allocation_strategy }}'
- name: tag_specifications
value:
- resource_type: '{{ resource_type }}'
tags:
- key: '{{ key }}'
value: '{{ value }}'
- name: instance_type_specifications
value:
- instance_type: '{{ instance_type }}'
instance_platform: '{{ instance_platform }}'
weight: null
availability_zone: '{{ availability_zone }}'
availability_zone_id: '{{ availability_zone_id }}'
ebs_optimized: '{{ ebs_optimized }}'
priority: '{{ priority }}'
- name: total_target_capacity
value: '{{ total_target_capacity }}'
- name: end_date
value: '{{ end_date }}'
- name: instance_match_criteria
value: '{{ instance_match_criteria }}'
- name: tenancy
value: '{{ tenancy }}'
- name: remove_end_date
value: '{{ remove_end_date }}'
- name: no_remove_end_date
value: '{{ no_remove_end_date }}'
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:
| Parameter | Description |
|---|---|
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:
- Create
- Delete
- List
- Read
- Update
ec2:CreateCapacityReservationFleet,
ec2:ModifyCapacityReservationFleet,
ec2:DescribeCapacityReservationFleets,
ec2:CancelCapacityReservationFleets,
ec2:CreateCapacityReservation,
ec2:DescribeCapacityReservations,
ec2:CancelCapacityReservation,
ec2:DescribeInstances,
ec2:CreateTags,
iam:CreateServiceLinkedRole
ec2:CreateCapacityReservationFleet,
ec2:ModifyCapacityReservationFleet,
ec2:DescribeCapacityReservationFleets,
ec2:CancelCapacityReservationFleets,
ec2:CreateCapacityReservation,
ec2:DescribeCapacityReservations,
ec2:CancelCapacityReservation,
ec2:DeleteTags
ec2:DescribeCapacityReservationFleets,
ec2:DescribeCapacityReservations,
ec2:DescribeInstances
ec2:DescribeCapacityReservationFleets,
ec2:DescribeInstances,
ec2:DescribeCapacityReservations
ec2:CreateCapacityReservationFleet,
ec2:ModifyCapacityReservationFleet,
ec2:DescribeCapacityReservationFleets,
ec2:CancelCapacityReservationFleets,
ec2:CreateCapacityReservation,
ec2:ModifyCapacityReservation,
ec2:DescribeCapacityReservations,
ec2:CancelCapacityReservation,
ec2:DescribeInstances,
ec2:DeleteTags