spot_placement_scores
Creates, updates, deletes, gets or lists a spot_placement_scores resource.
Overview
| Name | spot_placement_scores |
| Type | Resource |
| Id | aws.ec2.spot_placement_scores |
Fields
The following fields are returned by SELECT queries:
- get_spot_placement_scores
| Name | Datatype | Description |
|---|---|---|
availability_zone_id | string | The Availability Zone. |
region | string | The Region. |
score | integer | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_spot_placement_scores | select | TargetCapacity, region | InstanceType, TargetCapacityUnitType, SingleAvailabilityZone, RegionName, InstanceRequirementsWithMetadata, DryRun, MaxResults, NextToken, IncludeLocalZones | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
TargetCapacity | integer | The target capacity. |
region | string | AWS region (default: us-east-1) |
DryRun | boolean | Checks 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. |
IncludeLocalZones | boolean | Specify 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. |
InstanceRequirementsWithMetadata | object | The 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. |
InstanceType | array | The 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. |
MaxResults | integer | The 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. |
NextToken | string | The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request. |
RegionName | array | The Regions used to narrow down the list of Regions to be scored. Enter the Region code, for example, us-east-1. |
SingleAvailabilityZone | boolean | Specify 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. |
TargetCapacityUnitType | string | The unit for the target capacity. |
SELECT examples
- get_spot_placement_scores
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 }}'
;