Skip to content

get_spot_placement_scores

Operation

get_spot_placement_scores

get_spot_placement_scores(request: GetSpotPlacementScoresInput | GetSpotPlacementScoresInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetSpotPlacementScoresInputDict]) -> GetSpotPlacementScoresOutput

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:

Name Type Description Default
request GetSpotPlacementScoresInput | GetSpotPlacementScoresInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[GetSpotPlacementScoresInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetSpotPlacementScoresOutput

An instance of GetSpotPlacementScoresOutput.

get_spot_placement_scores async

get_spot_placement_scores(request: GetSpotPlacementScoresInput | GetSpotPlacementScoresInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetSpotPlacementScoresInputDict]) -> GetSpotPlacementScoresOutput

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:

Name Type Description Default
request GetSpotPlacementScoresInput | GetSpotPlacementScoresInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[GetSpotPlacementScoresInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
GetSpotPlacementScoresOutput

An instance of GetSpotPlacementScoresOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

GetSpotPlacementScoresInputDict

Bases: TypedDict

Dictionary form of GetSpotPlacementScoresInput.

Attributes

dry_run instance-attribute
dry_run: bool | None

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.

include_local_zones instance-attribute
include_local_zones: bool | None

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.

instance_requirements_with_metadata instance-attribute

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.

instance_types instance-attribute
instance_types: Sequence[str] | None

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.

max_results instance-attribute
max_results: int | None

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.

next_token instance-attribute
next_token: str | None

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

region_names instance-attribute
region_names: Sequence[str] | None

The Regions used to narrow down the list of Regions to be scored. Enter the Region code, for example, us-east-1.

single_availability_zone instance-attribute
single_availability_zone: bool | None

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.

target_capacity instance-attribute
target_capacity: Required[int]

The target capacity.

target_capacity_unit_type instance-attribute
target_capacity_unit_type: str | None

The unit for the target capacity.

GetSpotPlacementScoresInput dataclass

Bases: _SerdeShape

Dataclass for GetSpotPlacementScoresInput structure.

Attributes

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

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.

include_local_zones class-attribute instance-attribute
include_local_zones: bool | None = ...

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.

instance_requirements_with_metadata class-attribute instance-attribute
instance_requirements_with_metadata: InstanceRequirementsWithMetadataRequest | None = ...

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.

instance_types class-attribute instance-attribute
instance_types: list[str] | None = ...

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.

max_results class-attribute instance-attribute
max_results: int | None = ...

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.

next_token class-attribute instance-attribute
next_token: str | None = ...

The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

region_names class-attribute instance-attribute
region_names: list[str] | None = ...

The Regions used to narrow down the list of Regions to be scored. Enter the Region code, for example, us-east-1.

single_availability_zone class-attribute instance-attribute
single_availability_zone: bool | None = ...

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.

target_capacity class-attribute instance-attribute
target_capacity: int | None = ...

The target capacity.

target_capacity_unit_type class-attribute instance-attribute
target_capacity_unit_type: str | None = ...

The unit for the target capacity.

Output

GetSpotPlacementScoresOutput dataclass

Bases: _SerdeShape

Dataclass for GetSpotPlacementScoresOutput structure.

Attributes

next_token class-attribute instance-attribute
next_token: str | None = ...

The token to include in another request to get the next page of items. This value is null when there are no more items to return.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

spot_placement_scores class-attribute instance-attribute
spot_placement_scores: list[SpotPlacementScore] | None = ...

The Spot placement score for the top 10 Regions or Availability Zones, scored on a scale from 1 to 10. Each score
 reflects how likely it is that each Region or Availability Zone will succeed at fulfilling the specified target capacity
 at the time of the Spot placement score request. A score of 10 means that your Spot capacity request is highly likely to succeed in that Region or Availability Zone.

If you request a Spot placement score for Regions, a high score assumes that your fleet request will be configured to use all Availability Zones and the capacity-optimized allocation strategy. If you request a Spot placement score for Availability Zones, a high score assumes that your fleet request will be configured to use a single Availability Zone and the capacity-optimized allocation strategy.

Different
 Regions or Availability Zones might return the same score.

Note

The Spot placement score serves as a recommendation only. No score guarantees that your Spot request will be fully or partially fulfilled.