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 | aws.ec2.spot_fleets |
Fields
Name | Datatype | Description |
---|---|---|
id | string | |
spot_fleet_request_config_data | object | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | SpotFleetRequestConfigData, 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 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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.spot_fleets (
SpotFleetRequestConfigData,
region
)
SELECT
'{{ SpotFleetRequestConfigData }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.spot_fleets (
SpotFleetRequestConfigData,
region
)
SELECT
'{{ SpotFleetRequestConfigData }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: spot_fleet
props:
- name: SpotFleetRequestConfigData
value:
AllocationStrategy: '{{ AllocationStrategy }}'
Context: '{{ Context }}'
ExcessCapacityTerminationPolicy: '{{ ExcessCapacityTerminationPolicy }}'
IamFleetRole: '{{ IamFleetRole }}'
InstanceInterruptionBehavior: '{{ InstanceInterruptionBehavior }}'
InstancePoolsToUseCount: '{{ InstancePoolsToUseCount }}'
LaunchSpecifications:
- BlockDeviceMappings:
- DeviceName: '{{ DeviceName }}'
Ebs:
DeleteOnTermination: '{{ DeleteOnTermination }}'
Encrypted: '{{ Encrypted }}'
Iops: '{{ Iops }}'
SnapshotId: '{{ SnapshotId }}'
VolumeSize: '{{ VolumeSize }}'
VolumeType: '{{ VolumeType }}'
NoDevice: '{{ NoDevice }}'
VirtualName: '{{ VirtualName }}'
EbsOptimized: '{{ EbsOptimized }}'
IamInstanceProfile:
Arn: '{{ Arn }}'
ImageId: '{{ ImageId }}'
InstanceType: '{{ InstanceType }}'
KernelId: '{{ KernelId }}'
KeyName: '{{ KeyName }}'
Monitoring:
Enabled: '{{ Enabled }}'
NetworkInterfaces:
- AssociatePublicIpAddress: '{{ AssociatePublicIpAddress }}'
DeleteOnTermination: '{{ DeleteOnTermination }}'
Description: '{{ Description }}'
DeviceIndex: '{{ DeviceIndex }}'
Groups:
- '{{ Groups[0] }}'
Ipv6AddressCount: '{{ Ipv6AddressCount }}'
Ipv6Addresses:
- Ipv6Address: '{{ Ipv6Address }}'
NetworkInterfaceId: '{{ NetworkInterfaceId }}'
PrivateIpAddresses:
- Primary: '{{ Primary }}'
PrivateIpAddress: '{{ PrivateIpAddress }}'
SecondaryPrivateIpAddressCount: '{{ SecondaryPrivateIpAddressCount }}'
SubnetId: '{{ SubnetId }}'
Placement:
AvailabilityZone: '{{ AvailabilityZone }}'
GroupName: '{{ GroupName }}'
Tenancy: '{{ Tenancy }}'
RamdiskId: '{{ RamdiskId }}'
SecurityGroups:
- GroupId: '{{ GroupId }}'
SpotPrice: '{{ SpotPrice }}'
SubnetId: '{{ SubnetId }}'
TagSpecifications:
- ResourceType: '{{ ResourceType }}'
Tags:
- Key: '{{ Key }}'
Value: '{{ Value }}'
UserData: '{{ UserData }}'
WeightedCapacity: null
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 }}'
LaunchTemplateConfigs:
- LaunchTemplateSpecification:
LaunchTemplateId: '{{ LaunchTemplateId }}'
LaunchTemplateName: '{{ LaunchTemplateName }}'
Version: '{{ Version }}'
Overrides:
- AvailabilityZone: '{{ AvailabilityZone }}'
InstanceType: '{{ InstanceType }}'
SpotPrice: '{{ SpotPrice }}'
SubnetId: '{{ SubnetId }}'
WeightedCapacity: null
InstanceRequirements: null
Priority: null
LoadBalancersConfig:
ClassicLoadBalancersConfig:
ClassicLoadBalancers:
- Name: '{{ Name }}'
TargetGroupsConfig:
TargetGroups:
- Arn: '{{ Arn }}'
OnDemandAllocationStrategy: '{{ OnDemandAllocationStrategy }}'
OnDemandMaxTotalPrice: '{{ OnDemandMaxTotalPrice }}'
OnDemandTargetCapacity: '{{ OnDemandTargetCapacity }}'
ReplaceUnhealthyInstances: '{{ ReplaceUnhealthyInstances }}'
SpotMaintenanceStrategies:
CapacityRebalance:
ReplacementStrategy: '{{ ReplacementStrategy }}'
TerminationDelay: '{{ TerminationDelay }}'
SpotMaxTotalPrice: '{{ SpotMaxTotalPrice }}'
SpotPrice: '{{ SpotPrice }}'
TargetCapacity: '{{ TargetCapacity }}'
TerminateInstancesWithExpiration: '{{ TerminateInstancesWithExpiration }}'
Type: '{{ Type }}'
ValidFrom: '{{ ValidFrom }}'
ValidUntil: '{{ ValidUntil }}'
TagSpecifications:
- null
TargetCapacityUnitType: '{{ TargetCapacityUnitType }}'
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