role_credentials
Creates, updates, deletes, gets or lists a role_credentials resource.
Overview
| Name | role_credentials |
| Type | Resource |
| Id | aws.sso.role_credentials |
Fields
The following fields are returned by SELECT queries:
- get_role_credentials
| Name | Datatype | Description |
|---|---|---|
access_key_id | string | The 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. |
expiration | integer (int64) | The date on which temporary security credentials expire. |
secret_access_key | string | The 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_token | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_role_credentials | select | role_name, account_id, x-amz-sso_bearer_token, region | Returns 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.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The identifier for the AWS account that is assigned to the user. |
region | string | AWS region (default: us-east-1) |
role_name | string | The friendly name of the role that is assigned to the user. |
x-amz-sso_bearer_token | string | The token issued by the CreateToken API call. For more information, see CreateToken in the IAM Identity Center OIDC API Reference Guide. |
SELECT examples
- get_role_credentials
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
;