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 | aws.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 | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | InstanceCount, AvailabilityZone, 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 capacity_reservations
in a region.
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
FROM aws.ec2.capacity_reservations
WHERE region = 'us-east-1';
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
FROM aws.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 aws.ec2.capacity_reservations (
AvailabilityZone,
InstanceCount,
InstancePlatform,
InstanceType,
region
)
SELECT
'{{ AvailabilityZone }}',
'{{ InstanceCount }}',
'{{ InstancePlatform }}',
'{{ InstanceType }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.capacity_reservations (
Tenancy,
EndDateType,
TagSpecifications,
AvailabilityZone,
EndDate,
EbsOptimized,
OutPostArn,
InstanceCount,
PlacementGroupArn,
InstancePlatform,
InstanceType,
EphemeralStorage,
InstanceMatchCriteria,
region
)
SELECT
'{{ Tenancy }}',
'{{ EndDateType }}',
'{{ TagSpecifications }}',
'{{ AvailabilityZone }}',
'{{ EndDate }}',
'{{ EbsOptimized }}',
'{{ OutPostArn }}',
'{{ InstanceCount }}',
'{{ PlacementGroupArn }}',
'{{ InstancePlatform }}',
'{{ InstanceType }}',
'{{ EphemeralStorage }}',
'{{ InstanceMatchCriteria }}',
'{{ 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 }}'
DELETE
example
/*+ delete */
DELETE FROM aws.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:CreateTags,
ec2:DeleteTags