Skip to main content

spot_placement_scores

Creates, updates, deletes, gets or lists a spot_placement_scores resource.

Overview

Namespot_placement_scores
TypeResource
Idaws.ec2.spot_placement_scores

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
availability_zone_idstringThe Availability Zone.
regionstringThe Region.
scoreintegerThe placement score, on a scale from 1 to 10. A score of 10 indicates that your Spot request is highly likely to succeed in this Region or Availability Zone. A score of 1 indicates that your Spot request is not likely to succeed.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_spot_placement_scoresselectTargetCapacity, regionInstanceType, TargetCapacityUnitType, SingleAvailabilityZone, RegionName, InstanceRequirementsWithMetadata, DryRun, MaxResults, NextToken, IncludeLocalZonesCalculates the Spot placement score for a Region or Availability Zone based on the specified target capacity and compute requirements. You can specify your compute requirements either by using InstanceRequirementsWithMetadata and letting Amazon EC2 choose the optimal instance types to fulfill your Spot request, or you can specify the instance types by using InstanceTypes. For more information, see Spot placement score in the Amazon EC2 User Guide.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
TargetCapacityintegerThe target capacity.
regionstringAWS region (default: us-east-1)
DryRunbooleanChecks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.
IncludeLocalZonesbooleanSpecify true so that the response returns scores that include Local Zones. Otherwise, the response ignores Local Zones. When you request regional scores, Local Zone capacity counts toward its parent Region.
InstanceRequirementsWithMetadataobjectThe attributes for the instance types. When you specify instance attributes, Amazon EC2 will identify instance types with those attributes. If you specify InstanceRequirementsWithMetadata, you can't specify InstanceTypes.
InstanceTypearrayThe instance types. We recommend that you specify at least three instance types. If you specify one or two instance types, or specify variations of a single instance type (for example, an m3.xlarge with and without instance storage), the returned placement score will always be low. If you specify InstanceTypes, you can't specify InstanceRequirementsWithMetadata.
MaxResultsintegerThe maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.
NextTokenstringThe token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
RegionNamearrayThe Regions used to narrow down the list of Regions to be scored. Enter the Region code, for example, us-east-1.
SingleAvailabilityZonebooleanSpecify true so that the response returns a list of scored Availability Zones. Otherwise, the response returns a list of scored Regions. A list of scored Availability Zones is useful if you want to launch all of your Spot capacity into a single Availability Zone.
TargetCapacityUnitTypestringThe unit for the target capacity.

SELECT examples

Calculates the Spot placement score for a Region or Availability Zone based on the specified target capacity and compute requirements. You can specify your compute requirements either by using InstanceRequirementsWithMetadata and letting Amazon EC2 choose the optimal instance types to fulfill your Spot request, or you can specify the instance types by using InstanceTypes. For more information, see Spot placement score in the Amazon EC2 User Guide.

SELECT
availability_zone_id,
region,
score
FROM aws.ec2.spot_placement_scores
WHERE TargetCapacity = '{{ TargetCapacity }}' -- required
AND region = '{{ region }}' -- required
AND InstanceType = '{{ InstanceType }}'
AND TargetCapacityUnitType = '{{ TargetCapacityUnitType }}'
AND SingleAvailabilityZone = '{{ SingleAvailabilityZone }}'
AND RegionName = '{{ RegionName }}'
AND InstanceRequirementsWithMetadata = '{{ InstanceRequirementsWithMetadata }}'
AND DryRun = '{{ DryRun }}'
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
AND IncludeLocalZones = '{{ IncludeLocalZones }}'
;