Skip to content

STSClient.get_scoped_credentials

rboto-sts==0.4.0 · Service index · Types

Model summary (excerpt): Returns a set of temporary security credentials that are scoped down from the caller's existing temporary security credentials. GetScopedCredentials preserves the caller's identity while narrowing the permissions and optionally shortening the session lifetime. For a comparison of GetScopedCredentials with the other API operations that produce temporary security credentials, see Requesting...

Install and imports

python -m pip install "rboto[sts]==0.4.0"
from rboto import STSClient
from rboto_sts.types import (
    GetScopedCredentialsOutput,
)

Signature

async def get_scoped_credentials(
    *,
    policy: str | None = None,
    duration_seconds: int | None = None,
    minimum_session_token_size: int | None = None,
    scoped_session_description: str | None = None,
) -> GetScopedCredentialsOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
policy No An IAM policy in JSON format that you want to use as a scope down policy. A request must provide at least one of Policy or DurationSeconds . Both parameters are optional individually, but you must specify at least one of them. The resulting session's permissions are the intersection of the calling session's existing permissions and this scope down policy. You cannot use this scope down policy...
duration_seconds No The duration, in seconds, of the resulting scoped down credentials. The value can range from 1 second to 129,600 seconds (36 hours). If you do not specify this value, the scoped down credentials will inherit the calling session's expiration time.
minimum_session_token_size No
scoped_session_description No A caller-supplied description of the scoped session. The value cannot exceed 256 characters. This description is logged to CloudTrail for the request, so you can use it to record the purpose of the scoped session.

Output

GetScopedCredentialsOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
credentials CredentialsOutput | None Always present CredentialsOutput
session_info ScopedSessionOutput | None Always present ScopedSessionOutput
session_token_utilization int | None Always present —
session_token_size int | None Always present —
scoped_policies_count int | None Always present —
source_identity str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

GetScopedCredentialsOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_sts.exceptions:

InsufficientSessionLifetimeError, InvalidSubjectCredentialsError, MalformedPolicyDocumentError, PackedPolicyTooLargeError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model