create_bearer_token
¶
create_bearer_token(
grant_type: ClientCredentialsGrantType,
resource: Resource,
*,
config_overrides: Optional[SigninClientConfig] = None,
duration_seconds: Optional[TokenDuration] = None,
) -> CreateBearerTokenResponse
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:
-
grant_type(ClientCredentialsGrantType) –The grant type. Must be "client_credentials".
-
resource(Resource) –The AWS service the bearer token is for. Example: "ecr.amazonaws.com".
-
duration_seconds(Optional[TokenDuration], default: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.
Raises:
-
AccessDeniedException–You do not have sufficient access to perform this action.
-
InternalServerException–The request failed because of an internal server error.
-
TooManyRequestsError–The request failed because you exceeded the request rate limit for this operation.
-
ValidationException–The request failed because it contains a malformed, missing, or invalid parameter.
-
UnknownServiceError–The service returned an error code this client does not model.