Skip to main content

accounts

Creates, updates, deletes, gets or lists an accounts resource.

Overview

Nameaccounts
TypeResource
Idaws.sso.accounts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_idstringThe identifier of the AWS account that is assigned to the user.
account_namestringThe display name of the AWS account that is assigned to the user.
email_addressstringThe email address of the AWS account that is assigned to the user.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_accountsselectx-amz-sso_bearer_token, regionnext_token, max_resultLists all AWS accounts assigned to the user. These AWS accounts are assigned by the administrator of the account. For more information, see Assign User Access in the IAM Identity Center User Guide. This operation returns a paginated response.

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
regionstringAWS region (default: us-east-1)
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.
max_resultintegerThis is the number of items clients can request per page.
next_tokenstring(Optional) When requesting subsequent pages, this is the page token from the previous response output.

SELECT examples

Lists all AWS accounts assigned to the user. These AWS accounts are assigned by the administrator of the account. For more information, see Assign User Access in the IAM Identity Center User Guide. This operation returns a paginated response.

SELECT
account_id,
account_name,
email_address
FROM aws.sso.accounts
WHERE `x-amz-sso_bearer_token` = '{{ x-amz-sso_bearer_token }}' -- required
AND region = '{{ region }}' -- required
AND next_token = '{{ next_token }}'
AND max_result = '{{ max_result }}'
;