ec2fleets
Creates, updates, deletes or gets an ec2fleet
resource or lists ec2fleets
in a region
Overview
Name | ec2fleets |
Type | Resource |
Description | Resource Type definition for AWS::EC2::EC2Fleet |
Id | aws.ec2.ec2fleets |
Fields
Name | Datatype | Description |
---|---|---|
target_capacity_specification | object | |
on_demand_options | object | |
type | string | |
excess_capacity_termination_policy | string | |
tag_specifications | array | |
spot_options | object | |
valid_from | string | |
replace_unhealthy_instances | boolean | |
launch_template_configs | array | |
fleet_id | string | |
terminate_instances_with_expiration | boolean | |
valid_until | string | |
context | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | TargetCapacitySpecification, LaunchTemplateConfigs, 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 ec2fleets
in a region.
SELECT
region,
target_capacity_specification,
on_demand_options,
type,
excess_capacity_termination_policy,
tag_specifications,
spot_options,
valid_from,
replace_unhealthy_instances,
launch_template_configs,
fleet_id,
terminate_instances_with_expiration,
valid_until,
context
FROM aws.ec2.ec2fleets
WHERE region = 'us-east-1';
Gets all properties from an individual ec2fleet
.
SELECT
region,
target_capacity_specification,
on_demand_options,
type,
excess_capacity_termination_policy,
tag_specifications,
spot_options,
valid_from,
replace_unhealthy_instances,
launch_template_configs,
fleet_id,
terminate_instances_with_expiration,
valid_until,
context
FROM aws.ec2.ec2fleets
WHERE region = 'us-east-1' AND data__Identifier = '<FleetId>';
INSERT
example
Use the following StackQL query and manifest file to create a new ec2fleet
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.ec2fleets (
TargetCapacitySpecification,
LaunchTemplateConfigs,
region
)
SELECT
'{{ TargetCapacitySpecification }}',
'{{ LaunchTemplateConfigs }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.ec2fleets (
TargetCapacitySpecification,
OnDemandOptions,
Type,
ExcessCapacityTerminationPolicy,
TagSpecifications,
SpotOptions,
ValidFrom,
ReplaceUnhealthyInstances,
LaunchTemplateConfigs,
TerminateInstancesWithExpiration,
ValidUntil,
Context,
region
)
SELECT
'{{ TargetCapacitySpecification }}',
'{{ OnDemandOptions }}',
'{{ Type }}',
'{{ ExcessCapacityTerminationPolicy }}',
'{{ TagSpecifications }}',
'{{ SpotOptions }}',
'{{ ValidFrom }}',
'{{ ReplaceUnhealthyInstances }}',
'{{ LaunchTemplateConfigs }}',
'{{ TerminateInstancesWithExpiration }}',
'{{ ValidUntil }}',
'{{ Context }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: ec2fleet
props:
- name: TargetCapacitySpecification
value:
DefaultTargetCapacityType: '{{ DefaultTargetCapacityType }}'
TargetCapacityUnitType: '{{ TargetCapacityUnitType }}'
TotalTargetCapacity: '{{ TotalTargetCapacity }}'
OnDemandTargetCapacity: '{{ OnDemandTargetCapacity }}'
SpotTargetCapacity: '{{ SpotTargetCapacity }}'
- name: OnDemandOptions
value:
SingleAvailabilityZone: '{{ SingleAvailabilityZone }}'
AllocationStrategy: '{{ AllocationStrategy }}'
SingleInstanceType: '{{ SingleInstanceType }}'
MinTargetCapacity: '{{ MinTargetCapacity }}'
MaxTotalPrice: '{{ MaxTotalPrice }}'
CapacityReservationOptions:
UsageStrategy: '{{ UsageStrategy }}'
- name: Type
value: '{{ Type }}'
- name: ExcessCapacityTerminationPolicy
value: '{{ ExcessCapacityTerminationPolicy }}'
- name: TagSpecifications
value:
- ResourceType: '{{ ResourceType }}'
Tags:
- Key: '{{ Key }}'
Value: '{{ Value }}'
- name: SpotOptions
value:
MaintenanceStrategies:
CapacityRebalance:
ReplacementStrategy: '{{ ReplacementStrategy }}'
TerminationDelay: '{{ TerminationDelay }}'
SingleAvailabilityZone: '{{ SingleAvailabilityZone }}'
AllocationStrategy: '{{ AllocationStrategy }}'
SingleInstanceType: '{{ SingleInstanceType }}'
MinTargetCapacity: '{{ MinTargetCapacity }}'
MaxTotalPrice: '{{ MaxTotalPrice }}'
InstanceInterruptionBehavior: '{{ InstanceInterruptionBehavior }}'
InstancePoolsToUseCount: '{{ InstancePoolsToUseCount }}'
- name: ValidFrom
value: '{{ ValidFrom }}'
- name: ReplaceUnhealthyInstances
value: '{{ ReplaceUnhealthyInstances }}'
- name: LaunchTemplateConfigs
value:
- LaunchTemplateSpecification:
LaunchTemplateName: '{{ LaunchTemplateName }}'
LaunchTemplateId: '{{ LaunchTemplateId }}'
Version: '{{ Version }}'
Overrides:
- WeightedCapacity: null
Placement:
GroupName: '{{ GroupName }}'
Tenancy: '{{ Tenancy }}'
SpreadDomain: '{{ SpreadDomain }}'
PartitionNumber: '{{ PartitionNumber }}'
AvailabilityZone: '{{ AvailabilityZone }}'
Affinity: '{{ Affinity }}'
HostId: '{{ HostId }}'
HostResourceGroupArn: '{{ HostResourceGroupArn }}'
GroupId: '{{ GroupId }}'
Priority: null
AvailabilityZone: '{{ AvailabilityZone }}'
SubnetId: '{{ SubnetId }}'
InstanceType: '{{ InstanceType }}'
InstanceRequirements:
VCpuCount:
Min: '{{ Min }}'
Max: '{{ Max }}'
MemoryMiB:
Min: '{{ Min }}'
Max: '{{ Max }}'
CpuManufacturers:
- '{{ CpuManufacturers[0] }}'
MemoryGiBPerVCpu:
Min: null
Max: null
AllowedInstanceTypes:
- '{{ AllowedInstanceTypes[0] }}'
ExcludedInstanceTypes:
- '{{ ExcludedInstanceTypes[0] }}'
InstanceGenerations:
- '{{ InstanceGenerations[0] }}'
SpotMaxPricePercentageOverLowestPrice: '{{ SpotMaxPricePercentageOverLowestPrice }}'
OnDemandMaxPricePercentageOverLowestPrice: '{{ OnDemandMaxPricePercentageOverLowestPrice }}'
MaxSpotPriceAsPercentageOfOptimalOnDemandPrice: '{{ MaxSpotPriceAsPercentageOfOptimalOnDemandPrice }}'
BareMetal: '{{ BareMetal }}'
BurstablePerformance: '{{ BurstablePerformance }}'
RequireHibernateSupport: '{{ RequireHibernateSupport }}'
NetworkBandwidthGbps:
Min: null
Max: null
NetworkInterfaceCount:
Min: '{{ Min }}'
Max: '{{ Max }}'
LocalStorage: '{{ LocalStorage }}'
LocalStorageTypes:
- '{{ LocalStorageTypes[0] }}'
TotalLocalStorageGB:
Min: null
Max: null
BaselineEbsBandwidthMbps:
Min: '{{ Min }}'
Max: '{{ Max }}'
AcceleratorTypes:
- '{{ AcceleratorTypes[0] }}'
AcceleratorCount:
Min: '{{ Min }}'
Max: '{{ Max }}'
AcceleratorManufacturers:
- '{{ AcceleratorManufacturers[0] }}'
AcceleratorNames:
- '{{ AcceleratorNames[0] }}'
AcceleratorTotalMemoryMiB:
Min: '{{ Min }}'
Max: '{{ Max }}'
MaxPrice: '{{ MaxPrice }}'
- name: TerminateInstancesWithExpiration
value: '{{ TerminateInstancesWithExpiration }}'
- name: ValidUntil
value: '{{ ValidUntil }}'
- name: Context
value: '{{ Context }}'
DELETE
example
/*+ delete */
DELETE FROM aws.ec2.ec2fleets
WHERE data__Identifier = '<FleetId>'
AND region = 'us-east-1';
Permissions
To operate on the ec2fleets
resource, the following permissions are required:
Create
ec2:CreateFleet,
ec2:DescribeFleets
Delete
ec2:DescribeFleets,
ec2:DeleteFleets
List
ec2:DescribeFleets
Read
ec2:DescribeFleets
Update
ec2:ModifyFleet,
ec2:DescribeFleets