capacity_reservations
Creates, updates, deletes or gets a capacity_reservation resource or lists capacity_reservations in a region
Overview
| Name | capacity_reservations |
| Type | Resource |
| Description | Resource Type definition for AWS::EC2::CapacityReservation |
| Id | awscc.ec2.capacity_reservations |
Fields
| Name | Datatype | Description |
|---|---|---|
tenancy | string | |
end_date_type | string | |
tag_specifications | array | |
availability_zone | string | |
total_instance_count | integer | |
end_date | string | |
ebs_optimized | boolean | |
out_post_arn | string | |
instance_count | integer | |
placement_group_arn | string | |
available_instance_count | integer | |
instance_platform | string | |
id | string | |
instance_type | string | |
ephemeral_storage | boolean | |
instance_match_criteria | string | |
unused_reservation_billing_owner_id | string | |
availability_zone_id | string | |
start_date | string | |
capacity_reservation_arn | string | |
create_date | string | |
state | string | |
owner_id | string | |
delivery_preference | string | |
capacity_reservation_fleet_id | string | |
reservation_type | string | |
capacity_allocation_set | array | |
commitment_info | object | |
region | string | AWS region. |
For more information, see AWS::EC2::CapacityReservation.
Methods
| Name | Accessible by | Required Params |
|---|---|---|
create_resource | INSERT | InstanceCount, InstancePlatform, InstanceType, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT examples
Gets all properties from an individual capacity_reservation.
SELECT
region,
tenancy,
end_date_type,
tag_specifications,
availability_zone,
total_instance_count,
end_date,
ebs_optimized,
out_post_arn,
instance_count,
placement_group_arn,
available_instance_count,
instance_platform,
id,
instance_type,
ephemeral_storage,
instance_match_criteria,
unused_reservation_billing_owner_id,
availability_zone_id,
start_date,
capacity_reservation_arn,
create_date,
state,
owner_id,
delivery_preference,
capacity_reservation_fleet_id,
reservation_type,
capacity_allocation_set,
commitment_info
FROM awscc.ec2.capacity_reservations
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';
INSERT example
Use the following StackQL query and manifest file to create a new capacity_reservation resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.capacity_reservations (
InstanceCount,
InstancePlatform,
InstanceType,
region
)
SELECT
'{{ InstanceCount }}',
'{{ InstancePlatform }}',
'{{ InstanceType }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ec2.capacity_reservations (
Tenancy,
EndDateType,
TagSpecifications,
AvailabilityZone,
EndDate,
EbsOptimized,
OutPostArn,
InstanceCount,
PlacementGroupArn,
InstancePlatform,
InstanceType,
EphemeralStorage,
InstanceMatchCriteria,
UnusedReservationBillingOwnerId,
AvailabilityZoneId,
region
)
SELECT
'{{ Tenancy }}',
'{{ EndDateType }}',
'{{ TagSpecifications }}',
'{{ AvailabilityZone }}',
'{{ EndDate }}',
'{{ EbsOptimized }}',
'{{ OutPostArn }}',
'{{ InstanceCount }}',
'{{ PlacementGroupArn }}',
'{{ InstancePlatform }}',
'{{ InstanceType }}',
'{{ EphemeralStorage }}',
'{{ InstanceMatchCriteria }}',
'{{ UnusedReservationBillingOwnerId }}',
'{{ AvailabilityZoneId }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: capacity_reservation
props:
- name: Tenancy
value: '{{ Tenancy }}'
- name: EndDateType
value: '{{ EndDateType }}'
- name: TagSpecifications
value:
- ResourceType: '{{ ResourceType }}'
Tags:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: AvailabilityZone
value: '{{ AvailabilityZone }}'
- name: EndDate
value: '{{ EndDate }}'
- name: EbsOptimized
value: '{{ EbsOptimized }}'
- name: OutPostArn
value: '{{ OutPostArn }}'
- name: InstanceCount
value: '{{ InstanceCount }}'
- name: PlacementGroupArn
value: '{{ PlacementGroupArn }}'
- name: InstancePlatform
value: '{{ InstancePlatform }}'
- name: InstanceType
value: '{{ InstanceType }}'
- name: EphemeralStorage
value: '{{ EphemeralStorage }}'
- name: InstanceMatchCriteria
value: '{{ InstanceMatchCriteria }}'
- name: UnusedReservationBillingOwnerId
value: '{{ UnusedReservationBillingOwnerId }}'
- name: AvailabilityZoneId
value: '{{ AvailabilityZoneId }}'
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.capacity_reservations
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';
Permissions
To operate on the capacity_reservations resource, the following permissions are required:
Create
ec2:CreateCapacityReservation,
ec2:DescribeCapacityReservations,
ec2:CancelCapacityReservation,
ec2:CreateTags
Delete
ec2:CreateCapacityReservation,
ec2:DescribeCapacityReservations,
ec2:CancelCapacityReservation,
ec2:DeleteTags
List
ec2:DescribeCapacityReservations
Read
ec2:DescribeCapacityReservations
Update
ec2:ModifyCapacityReservation,
ec2:CreateCapacityReservation,
ec2:DescribeCapacityReservations,
ec2:CancelCapacityReservation,
ec2:AssociateCapacityReservationBillingOwner,
ec2:CreateTags,
ec2:DeleteTags