spot_fleets
Creates, updates, deletes or gets a spot_fleet resource or lists spot_fleets in a region
Overview
| Name | spot_fleets |
| Type | Resource |
| Description | Resource Type definition for AWS::EC2::SpotFleet |
| Id | awscc.ec2.spot_fleets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
id | string | |
spot_fleet_request_config_data | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
id | string | |
region | string | AWS region. |
For more information, see AWS::EC2::SpotFleet.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | spot_fleets | INSERT | SpotFleetRequestConfigData, region |
delete_resource | spot_fleets | DELETE | Identifier, region |
update_resource | spot_fleets | UPDATE | Identifier, PatchDocument, region |
list_resources | spot_fleets_list_only | SELECT | region |
get_resource | spot_fleets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual spot_fleet.
SELECT
region,
id,
spot_fleet_request_config_data
FROM awscc.ec2.spot_fleets
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';
Lists all spot_fleets in a region.
SELECT
region,
id
FROM awscc.ec2.spot_fleets_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new spot_fleet resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.ec2.spot_fleets (
SpotFleetRequestConfigData,
region
)
SELECT
'{{ spot_fleet_request_config_data }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.ec2.spot_fleets (
SpotFleetRequestConfigData,
region
)
SELECT
'{{ spot_fleet_request_config_data }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: spot_fleet
props:
- name: spot_fleet_request_config_data
value:
allocation_strategy: '{{ allocation_strategy }}'
context: '{{ context }}'
excess_capacity_termination_policy: '{{ excess_capacity_termination_policy }}'
iam_fleet_role: '{{ iam_fleet_role }}'
instance_interruption_behavior: '{{ instance_interruption_behavior }}'
instance_pools_to_use_count: '{{ instance_pools_to_use_count }}'
launch_specifications:
- block_device_mappings:
- device_name: '{{ device_name }}'
ebs:
delete_on_termination: '{{ delete_on_termination }}'
encrypted: '{{ encrypted }}'
iops: '{{ iops }}'
snapshot_id: '{{ snapshot_id }}'
volume_size: '{{ volume_size }}'
volume_type: '{{ volume_type }}'
no_device: '{{ no_device }}'
virtual_name: '{{ virtual_name }}'
ebs_optimized: '{{ ebs_optimized }}'
iam_instance_profile:
arn: '{{ arn }}'
image_id: '{{ image_id }}'
instance_type: '{{ instance_type }}'
kernel_id: '{{ kernel_id }}'
key_name: '{{ key_name }}'
monitoring:
enabled: '{{ enabled }}'
network_interfaces:
- associate_public_ip_address: '{{ associate_public_ip_address }}'
delete_on_termination: '{{ delete_on_termination }}'
description: '{{ description }}'
device_index: '{{ device_index }}'
groups:
- '{{ groups[0] }}'
ipv6_address_count: '{{ ipv6_address_count }}'
ipv6_addresses:
- ipv6_address: '{{ ipv6_address }}'
network_interface_id: '{{ network_interface_id }}'
private_ip_addresses:
- primary: '{{ primary }}'
private_ip_address: '{{ private_ip_address }}'
secondary_private_ip_address_count: '{{ secondary_private_ip_address_count }}'
subnet_id: '{{ subnet_id }}'
placement:
availability_zone: '{{ availability_zone }}'
group_name: '{{ group_name }}'
tenancy: '{{ tenancy }}'
ramdisk_id: '{{ ramdisk_id }}'
security_groups:
- group_id: '{{ group_id }}'
spot_price: '{{ spot_price }}'
subnet_id: '{{ subnet_id }}'
tag_specifications:
- resource_type: '{{ resource_type }}'
tags:
- key: '{{ key }}'
value: '{{ value }}'
user_data: '{{ user_data }}'
weighted_capacity: null
instance_requirements:
v_cpu_count:
min: '{{ min }}'
max: '{{ max }}'
memory_mi_b:
min: '{{ min }}'
max: '{{ max }}'
cpu_manufacturers:
- '{{ cpu_manufacturers[0] }}'
memory_gi_bper_vcpu:
min: null
max: null
allowed_instance_types:
- '{{ allowed_instance_types[0] }}'
excluded_instance_types:
- '{{ excluded_instance_types[0] }}'
instance_generations:
- '{{ instance_generations[0] }}'
spot_max_price_percentage_over_lowest_price: '{{ spot_max_price_percentage_over_lowest_price }}'
on_demand_max_price_percentage_over_lowest_price: '{{ on_demand_max_price_percentage_over_lowest_price }}'
max_spot_price_as_percentage_of_optimal_on_demand_price: '{{ max_spot_price_as_percentage_of_optimal_on_demand_price }}'
bare_metal: '{{ bare_metal }}'
burstable_performance: '{{ burstable_performance }}'
require_hibernate_support: '{{ require_hibernate_support }}'
network_bandwidth_gbps:
min: null
max: null
network_interface_count:
min: '{{ min }}'
max: '{{ max }}'
local_storage: '{{ local_storage }}'
local_storage_types:
- '{{ local_storage_types[0] }}'
total_local_storage_gb:
min: null
max: null
baseline_ebs_bandwidth_mbps:
min: '{{ min }}'
max: '{{ max }}'
accelerator_types:
- '{{ accelerator_types[0] }}'
accelerator_count:
min: '{{ min }}'
max: '{{ max }}'
accelerator_manufacturers:
- '{{ accelerator_manufacturers[0] }}'
accelerator_names:
- '{{ accelerator_names[0] }}'
accelerator_total_memory_mi_b:
min: '{{ min }}'
max: '{{ max }}'
baseline_performance_factors:
cpu:
references:
- instance_family: '{{ instance_family }}'
launch_template_configs:
- launch_template_specification:
launch_template_id: '{{ launch_template_id }}'
launch_template_name: '{{ launch_template_name }}'
version: '{{ version }}'
overrides:
- availability_zone: '{{ availability_zone }}'
instance_type: '{{ instance_type }}'
spot_price: '{{ spot_price }}'
subnet_id: '{{ subnet_id }}'
weighted_capacity: null
instance_requirements: null
priority: null
load_balancers_config:
classic_load_balancers_config:
classic_load_balancers:
- name: '{{ name }}'
target_groups_config:
target_groups:
- arn: '{{ arn }}'
on_demand_allocation_strategy: '{{ on_demand_allocation_strategy }}'
on_demand_max_total_price: '{{ on_demand_max_total_price }}'
on_demand_target_capacity: '{{ on_demand_target_capacity }}'
replace_unhealthy_instances: '{{ replace_unhealthy_instances }}'
spot_maintenance_strategies:
capacity_rebalance:
replacement_strategy: '{{ replacement_strategy }}'
termination_delay: '{{ termination_delay }}'
spot_max_total_price: '{{ spot_max_total_price }}'
spot_price: '{{ spot_price }}'
target_capacity: '{{ target_capacity }}'
terminate_instances_with_expiration: '{{ terminate_instances_with_expiration }}'
type: '{{ type }}'
valid_from: '{{ valid_from }}'
valid_until: '{{ valid_until }}'
tag_specifications:
- null
target_capacity_unit_type: '{{ target_capacity_unit_type }}'
DELETE example
/*+ delete */
DELETE FROM awscc.ec2.spot_fleets
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';
Permissions
To operate on the spot_fleets resource, the following permissions are required:
- Create
- Delete
- List
- Read
- Update
iam:PassRole,
ec2:CreateTags,
ec2:RequestSpotFleet,
ec2:DescribeSpotFleetRequests,
ec2:RunInstances
ec2:DescribeSpotFleetRequests,
ec2:CancelSpotFleetRequests
ec2:DescribeSpotFleetRequests
ec2:DescribeSpotFleetRequests
ec2:ModifySpotFleetRequest,
ec2:DescribeSpotFleetRequests