Skip to main content

role_credentials

Creates, updates, deletes, gets or lists a role_credentials resource.

Overview

Namerole_credentials
TypeResource
Idaws.sso.role_credentials

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
access_key_idstringThe identifier used for the temporary security credentials. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the AWS IAM User Guide.
expirationinteger (int64)The date on which temporary security credentials expire.
secret_access_keystringThe key that is used to sign the request. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the AWS IAM User Guide.
session_tokenstringThe token used for temporary credentials. For more information, see Using Temporary Security Credentials to Request Access to AWS Resources in the AWS IAM User Guide.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_role_credentialsselectrole_name, account_id, x-amz-sso_bearer_token, regionReturns the STS short-term credentials for a given role name that is assigned to the user.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_idstringThe identifier for the AWS account that is assigned to the user.
regionstringAWS region (default: us-east-1)
role_namestringThe friendly name of the role that is assigned to the user.
x-amz-sso_bearer_tokenstringThe token issued by the CreateToken API call. For more information, see CreateToken in the IAM Identity Center OIDC API Reference Guide.

SELECT examples

Returns the STS short-term credentials for a given role name that is assigned to the user.

SELECT
access_key_id,
expiration,
secret_access_key,
session_token
FROM aws.sso.role_credentials
WHERE role_name = '{{ role_name }}' -- required
AND account_id = '{{ account_id }}' -- required
AND `x-amz-sso_bearer_token` = '{{ x-amz-sso_bearer_token }}' -- required
AND region = '{{ region }}' -- required
;