Skip to content

IAM  >  Operations  >  set_security_token_service_preferences

set_security_token_service_preferences

Operation

set_security_token_service_preferences async

set_security_token_service_preferences(request: SetSecurityTokenServicePreferencesInput | SetSecurityTokenServicePreferencesInputDict, /, *, plugins: list[Plugin] | None = None) -> SetSecurityTokenServicePreferencesOutput
set_security_token_service_preferences(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[SetSecurityTokenServicePreferencesInputDict]) -> SetSecurityTokenServicePreferencesOutput

Sets the specified version of the global endpoint token as the token version used for the Amazon Web Services account.

By default, Security Token Service (STS) is available as a global service, and all STS requests go to a single endpoint at https://sts.amazonaws.com. Amazon Web Services recommends using Regional STS endpoints to reduce latency, build in redundancy, and increase session token availability. For information about Regional endpoints for STS, see Security Token Service endpoints and quotas in the Amazon Web Services General Reference.

If you make an STS call to the global endpoint, the resulting session tokens might be valid in some Regions but not others. It depends on the version that is set in this operation. Version 1 tokens are valid only in Amazon Web Services Regions that are available by default. These tokens do not work in manually enabled Regions, such as Asia Pacific (Hong Kong). Version 2 tokens are valid in all Regions. However, version 2 tokens are longer and might affect systems where you temporarily store tokens. For information, see Activating and deactivating STS in an Amazon Web Services Region in the IAM User Guide.

To view the current session token version, see the GlobalEndpointTokenVersion entry in the response of the GetAccountSummary operation.

Parameters:

Name Type Description Default
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

Returns:

Type Description
SetSecurityTokenServicePreferencesOutput

An instance of SetSecurityTokenServicePreferencesOutput.

Input

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

Model

SetSecurityTokenServicePreferencesInput dataclass

Bases: _SerdeShape

Dataclass for SetSecurityTokenServicePreferencesInput structure.

Attributes
global_endpoint_token_version class-attribute instance-attribute
global_endpoint_token_version: str | None = ...

The version of the global endpoint token. Version 1 tokens are valid only in Amazon Web Services Regions that are available by default. These tokens do not work in manually enabled Regions, such as Asia Pacific (Hong Kong). Version 2 tokens are valid in all Regions. However, version 2 tokens are longer and might affect systems where you temporarily store tokens.

For information, see Activating and deactivating STS in an Amazon Web Services Region in the IAM User Guide.

Dictionaries

SetSecurityTokenServicePreferencesInputDict

Bases: TypedDict

Dictionary form of SetSecurityTokenServicePreferencesInput.

Attributes
global_endpoint_token_version instance-attribute
global_endpoint_token_version: Required[str]

The version of the global endpoint token. Version 1 tokens are valid only in Amazon Web Services Regions that are available by default. These tokens do not work in manually enabled Regions, such as Asia Pacific (Hong Kong). Version 2 tokens are valid in all Regions. However, version 2 tokens are longer and might affect systems where you temporarily store tokens.

For information, see Activating and deactivating STS in an Amazon Web Services Region in the IAM User Guide.

Output

SetSecurityTokenServicePreferencesOutput dataclass

Bases: _SerdeShape

Dataclass for SetSecurityTokenServicePreferencesOutput structure.

Attributes

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.