Skip to content

create_bearer_token

Operation

create_bearer_token

create_bearer_token(request: CreateBearerTokenInput | CreateBearerTokenInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateBearerTokenInputDict]) -> CreateBearerTokenOutput

Creates a bearer token that represents your IAM credentials and can be used to access a supported AWS service. By default, the token is valid for 12 hours.

Parameters:

Name Type Description Default
request CreateBearerTokenInput | CreateBearerTokenInputDict | 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[CreateBearerTokenInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateBearerTokenOutput

An instance of CreateBearerTokenOutput.

create_bearer_token async

create_bearer_token(request: CreateBearerTokenInput | CreateBearerTokenInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateBearerTokenInputDict]) -> CreateBearerTokenOutput

Creates a bearer token that represents your IAM credentials and can be used to access a supported AWS service. By default, the token is valid for 12 hours.

Parameters:

Name Type Description Default
request CreateBearerTokenInput | CreateBearerTokenInputDict | 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[CreateBearerTokenInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateBearerTokenOutput

An instance of CreateBearerTokenOutput.

Input

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

CreateBearerTokenInputDict

Bases: TypedDict

Dictionary form of CreateBearerTokenInput.

Attributes

duration_seconds instance-attribute
duration_seconds: int | None

The requested token lifetime in seconds, from 300 (5 minutes) up to the maximum allowed for the service, currently 43200 (12 hours). If omitted, the token is valid for 12 hours.

grant_type instance-attribute
grant_type: Required[str]

The grant type. Must be "client_credentials".

resource instance-attribute
resource: Required[str]

The AWS service the bearer token is for. Example: "ecr.amazonaws.com".

CreateBearerTokenInput dataclass

Bases: _SerdeShape

Input structure for CreateBearerToken operation

Attributes

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

The requested token lifetime in seconds, from 300 (5 minutes) up to the maximum allowed for the service, currently 43200 (12 hours). If omitted, the token is valid for 12 hours.

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

The grant type. Must be "client_credentials".

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

The AWS service the bearer token is for. Example: "ecr.amazonaws.com".

Output

CreateBearerTokenOutput dataclass

Bases: _SerdeShape

Output structure for CreateBearerToken operation Contains the bearer token, its type, and its lifetime.

Attributes

access_token instance-attribute
access_token: str

The bearer token. Present it to the AWS service named in the request.

expires_in instance-attribute
expires_in: int

Token lifetime in seconds.

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.

token_type instance-attribute
token_type: str

The token type. Always "Bearer".