Skip to main content

spot_fleets

Creates, updates, deletes or gets a spot_fleet resource or lists spot_fleets in a region

Overview

Namespot_fleets
TypeResource
DescriptionResource Type definition for AWS::EC2::SpotFleet
Idaws.ec2.spot_fleets

Fields

NameDatatypeDescription
idstring
spot_fleet_request_config_dataobject
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTSpotFleetRequestConfigData, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all spot_fleets in a region.

SELECT
region,
id,
spot_fleet_request_config_data
FROM aws.ec2.spot_fleets
WHERE region = 'us-east-1';

Gets all properties from an individual spot_fleet.

SELECT
region,
id,
spot_fleet_request_config_data
FROM aws.ec2.spot_fleets
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';

INSERT example

Use the following StackQL query and manifest file to create a new spot_fleet resource, using stack-deploy.

/*+ create */
INSERT INTO aws.ec2.spot_fleets (
SpotFleetRequestConfigData,
region
)
SELECT
'{{ SpotFleetRequestConfigData }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ec2.spot_fleets
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

To operate on the spot_fleets resource, the following permissions are required:

Create

iam:PassRole,
ec2:CreateTags,
ec2:RequestSpotFleet,
ec2:DescribeSpotFleetRequests,
ec2:RunInstances

Delete

ec2:DescribeSpotFleetRequests,
ec2:CancelSpotFleetRequests

List

ec2:DescribeSpotFleetRequests

Read

ec2:DescribeSpotFleetRequests

Update

ec2:ModifySpotFleetRequest,
ec2:DescribeSpotFleetRequests