Skip to content

aws.iam.get_account_authorization_details

Example SQL Queries

SELECT * FROM
aws.iam.get_account_authorization_details;

Description

Retrieves information about all IAM users, groups, roles, and policies in your Amazon Web Services account, including their relationships to one another. Use this operation to obtain a snapshot of the configuration of IAM permissions (users, groups, roles, and policies) in your account.

Policies returned by this operation are URL-encoded compliant with RFC 3986. You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

You can optionally filter the results using the Filter parameter. You can paginate the results using the MaxItems and Marker parameters.

Table Definition

Column NameColumn Data Type
filter Input Column

A list of entity types used to filter the results. Only the entities that match the types you specify are included in the output. Use the value LocalManagedPolicy to include customer managed policies.

The format for this parameter is a comma-separated (if more than one) list of strings. Each string value in the list must be one of the valid values listed below.

VARCHAR[]
Show child fields
filter[]
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

group_detail_list

A list containing information about IAM groups.

STRUCT(
"path" VARCHAR,
"group_name" VARCHAR,
"group_id" VARCHAR,
"arn" VARCHAR,
"create_date" TIMESTAMP_S,
"group_policy_list" STRUCT(
"policy_name" VARCHAR,
"policy_document" VARCHAR
)[],
"attached_managed_policies" STRUCT(
"policy_name" VARCHAR,
"policy_arn" VARCHAR
)[]
)[]
Show child fields
group_detail_list[]
Show child fields
group_detail_list[].arn

The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

group_detail_list[].attached_managed_policies[]
Show child fields
group_detail_list[].attached_managed_policies[].policy_arn

The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

group_detail_list[].attached_managed_policies[].policy_name

The friendly name of the attached policy.

group_detail_list[].create_date

The date and time, in ISO 8601 date-time format, when the group was created.

group_detail_list[].group_id

The stable and unique string identifying the group. For more information about IDs, see IAM identifiers in the IAM User Guide.

group_detail_list[].group_name

The friendly name that identifies the group.

group_detail_list[].group_policy_list[]
Show child fields
group_detail_list[].group_policy_list[].policy_document

The policy document.

group_detail_list[].group_policy_list[].policy_name

The name of the policy.

group_detail_list[].path

The path to the group. For more information about paths, see IAM identifiers in the IAM User Guide.

policies

A list containing information about managed policies.

STRUCT(
"policy_name" VARCHAR,
"policy_id" VARCHAR,
"arn" VARCHAR,
"path" VARCHAR,
"default_version_id" VARCHAR,
"attachment_count" BIGINT,
"permissions_boundary_usage_count" BIGINT,
"is_attachable" BOOLEAN,
"description" VARCHAR,
"create_date" TIMESTAMP_S,
"update_date" TIMESTAMP_S,
"policy_version_list" STRUCT(
"document" VARCHAR,
"version_id" VARCHAR,
"is_default_version" BOOLEAN,
"create_date" TIMESTAMP_S
)[]
)[]
Show child fields
policies[]
Show child fields
policies[].arn

The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

policies[].attachment_count

The number of principal entities (users, groups, and roles) that the policy is attached to.

policies[].create_date

The date and time, in ISO 8601 date-time format, when the policy was created.

policies[].default_version_id

The identifier for the version of the policy that is set as the default (operative) version.

For more information about policy versions, see Versioning for managed policies in the IAM User Guide.

policies[].description

A friendly description of the policy.

policies[].is_attachable

Specifies whether the policy can be attached to an IAM user, group, or role.

policies[].path

The path to the policy.

For more information about paths, see IAM identifiers in the IAM User Guide.

policies[].permissions_boundary_usage_count

The number of entities (users and roles) for which the policy is used as the permissions boundary.

For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.

policies[].policy_id

The stable and unique string identifying the policy.

For more information about IDs, see IAM identifiers in the IAM User Guide.

policies[].policy_name

The friendly name (not ARN) identifying the policy.

policies[].policy_version_list[]
Show child fields
policies[].policy_version_list[].create_date

The date and time, in ISO 8601 date-time format, when the policy version was created.

policies[].policy_version_list[].document

The policy document.

The policy document is returned in the response to the GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in the response to the CreatePolicyVersion or ListPolicyVersions operations.

The policy document returned in this structure is URL-encoded compliant with RFC 3986. You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

policies[].policy_version_list[].is_default_version

Specifies whether the policy version is set as the policy's default version.

policies[].policy_version_list[].version_id

The identifier for the policy version.

Policy version identifiers always begin with v (always lowercase). When a policy is created, the first policy version is v1.

policies[].update_date

The date and time, in ISO 8601 date-time format, when the policy was last updated.

When a policy has only one version, this field contains the date and time when the policy was created. When a policy has more than one version, this field contains the date and time when the most recent policy version was created.

role_detail_list

A list containing information about IAM roles.

STRUCT(
"path" VARCHAR,
"role_name" VARCHAR,
"role_id" VARCHAR,
"arn" VARCHAR,
"create_date" TIMESTAMP_S,
"assume_role_policy_document" VARCHAR,
"instance_profile_list" STRUCT(
"path" VARCHAR,
"instance_profile_name" VARCHAR,
"instance_profile_id" VARCHAR,
"arn" VARCHAR,
"create_date" TIMESTAMP_S,
"roles" STRUCT(
"path" VARCHAR,
"role_name" VARCHAR,
"role_id" VARCHAR,
"arn" VARCHAR,
"create_date" TIMESTAMP_S,
"assume_role_policy_document" VARCHAR,
"description" VARCHAR,
"max_session_duration" BIGINT,
"permissions_boundary" STRUCT(
"permissions_boundary_type" VARCHAR,
"permissions_boundary_arn" VARCHAR
),
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"role_last_used" STRUCT(
"last_used_date" TIMESTAMP_S,
"region" VARCHAR
)
)[],
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[],
"role_policy_list" STRUCT(
"policy_name" VARCHAR,
"policy_document" VARCHAR
)[],
"attached_managed_policies" STRUCT(
"policy_name" VARCHAR,
"policy_arn" VARCHAR
)[],
"permissions_boundary" STRUCT(
"permissions_boundary_type" VARCHAR,
"permissions_boundary_arn" VARCHAR
),
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"role_last_used" STRUCT(
"last_used_date" TIMESTAMP_S,
"region" VARCHAR
)
)[]
Show child fields
role_detail_list[]
Show child fields
role_detail_list[].arn

The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

role_detail_list[].assume_role_policy_document

The trust policy that grants permission to assume the role.

role_detail_list[].attached_managed_policies[]
Show child fields
role_detail_list[].attached_managed_policies[].policy_arn

The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

role_detail_list[].attached_managed_policies[].policy_name

The friendly name of the attached policy.

role_detail_list[].create_date

The date and time, in ISO 8601 date-time format, when the role was created.

role_detail_list[].instance_profile_list[]
Show child fields
role_detail_list[].instance_profile_list[].arn

The Amazon Resource Name (ARN) specifying the instance profile. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide.

role_detail_list[].instance_profile_list[].create_date

The date when the instance profile was created.

role_detail_list[].instance_profile_list[].instance_profile_id

The stable and unique string identifying the instance profile. For more information about IDs, see IAM identifiers in the IAM User Guide.

role_detail_list[].instance_profile_list[].instance_profile_name

The name identifying the instance profile.

role_detail_list[].instance_profile_list[].path

The path to the instance profile. For more information about paths, see IAM identifiers in the IAM User Guide.

role_detail_list[].instance_profile_list[].roles[]
Show child fields
role_detail_list[].instance_profile_list[].roles[].arn

The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide guide.

role_detail_list[].instance_profile_list[].roles[].assume_role_policy_document

The policy that grants an entity permission to assume the role.

role_detail_list[].instance_profile_list[].roles[].create_date

The date and time, in ISO 8601 date-time format, when the role was created.

role_detail_list[].instance_profile_list[].roles[].description

A description of the role that you provide.

role_detail_list[].instance_profile_list[].roles[].max_session_duration

The maximum session duration (in seconds) for the specified role. Anyone who uses the CLI, or API to assume the role can specify the duration using the optional DurationSeconds API parameter or duration-seconds CLI parameter.

role_detail_list[].instance_profile_list[].roles[].path

The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide.

role_detail_list[].instance_profile_list[].roles[].permissions_boundary

The ARN of the policy used to set the permissions boundary for the role.

For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.

Show child fields
role_detail_list[].instance_profile_list[].roles[].permissions_boundary.permissions_boundary_arn

The ARN of the policy used to set the permissions boundary for the user or role.

role_detail_list[].instance_profile_list[].roles[].permissions_boundary.permissions_boundary_type

The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy.

role_detail_list[].instance_profile_list[].roles[].role_id

The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide.

role_detail_list[].instance_profile_list[].roles[].role_last_used

Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM user Guide.

Show child fields
role_detail_list[].instance_profile_list[].roles[].role_last_used.last_used_date

The date and time, in ISO 8601 date-time format that the role was last used.

This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide.

role_detail_list[].instance_profile_list[].roles[].role_last_used.region

The name of the Amazon Web Services Region in which the role was last used.

role_detail_list[].instance_profile_list[].roles[].role_name

The friendly name that identifies the role.

role_detail_list[].instance_profile_list[].roles[].tags[]
Show child fields
role_detail_list[].instance_profile_list[].roles[].tags[].key

The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.

role_detail_list[].instance_profile_list[].roles[].tags[].value

The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources, Accounting, and Support. Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.

Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.

role_detail_list[].instance_profile_list[].tags[]
Show child fields
role_detail_list[].instance_profile_list[].tags[].key

The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.

role_detail_list[].instance_profile_list[].tags[].value

The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources, Accounting, and Support. Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.

Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.

role_detail_list[].path

The path to the role. For more information about paths, see IAM identifiers in the IAM User Guide.

role_detail_list[].permissions_boundary

The ARN of the policy used to set the permissions boundary for the role.

For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.

Show child fields
role_detail_list[].permissions_boundary.permissions_boundary_arn

The ARN of the policy used to set the permissions boundary for the user or role.

role_detail_list[].permissions_boundary.permissions_boundary_type

The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy.

role_detail_list[].role_id

The stable and unique string identifying the role. For more information about IDs, see IAM identifiers in the IAM User Guide.

role_detail_list[].role_last_used

Contains information about the last time that an IAM role was used. This includes the date and time and the Region in which the role was last used. Activity is only reported for the trailing 400 days. This period can be shorter if your Region began supporting these features within the last year. The role might have been used more than 400 days ago. For more information, see Regions where data is tracked in the IAM User Guide.

Show child fields
role_detail_list[].role_last_used.last_used_date

The date and time, in ISO 8601 date-time format that the role was last used.

This field is null if the role has not been used within the IAM tracking period. For more information about the tracking period, see Regions where data is tracked in the IAM User Guide.

role_detail_list[].role_last_used.region

The name of the Amazon Web Services Region in which the role was last used.

role_detail_list[].role_name

The friendly name that identifies the role.

role_detail_list[].role_policy_list[]
Show child fields
role_detail_list[].role_policy_list[].policy_document

The policy document.

role_detail_list[].role_policy_list[].policy_name

The name of the policy.

role_detail_list[].tags[]
Show child fields
role_detail_list[].tags[].key

The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.

role_detail_list[].tags[].value

The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources, Accounting, and Support. Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.

Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.

user_detail_list

A list containing information about IAM users.

STRUCT(
"path" VARCHAR,
"user_name" VARCHAR,
"user_id" VARCHAR,
"arn" VARCHAR,
"create_date" TIMESTAMP_S,
"user_policy_list" STRUCT(
"policy_name" VARCHAR,
"policy_document" VARCHAR
)[],
"group_list" VARCHAR[],
"attached_managed_policies" STRUCT(
"policy_name" VARCHAR,
"policy_arn" VARCHAR
)[],
"permissions_boundary" STRUCT(
"permissions_boundary_type" VARCHAR,
"permissions_boundary_arn" VARCHAR
),
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
Show child fields
user_detail_list[]
Show child fields
user_detail_list[].arn

The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

user_detail_list[].attached_managed_policies[]
Show child fields
user_detail_list[].attached_managed_policies[].policy_arn

The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

user_detail_list[].attached_managed_policies[].policy_name

The friendly name of the attached policy.

user_detail_list[].create_date

The date and time, in ISO 8601 date-time format, when the user was created.

user_detail_list[].group_list[]
user_detail_list[].path

The path to the user. For more information about paths, see IAM identifiers in the IAM User Guide.

user_detail_list[].permissions_boundary

The ARN of the policy used to set the permissions boundary for the user.

For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide.

Show child fields
user_detail_list[].permissions_boundary.permissions_boundary_arn

The ARN of the policy used to set the permissions boundary for the user or role.

user_detail_list[].permissions_boundary.permissions_boundary_type

The permissions boundary usage type that indicates what type of IAM resource is used as the permissions boundary for an entity. This data type can only have a value of Policy.

user_detail_list[].tags[]
Show child fields
user_detail_list[].tags[].key

The key name that can be used to look up or retrieve the associated value. For example, Department or Cost Center are common choices.

user_detail_list[].tags[].value

The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources, Accounting, and Support. Tags with a key name of Cost Center might have values that consist of the number associated with the different cost centers in your company. Typically, many resources have tags with the same key name but with different values.

Amazon Web Services always interprets the tag Value as a single string. If you need to store an array, you can store comma-separated values in the string. However, you must interpret the value in your code.

user_detail_list[].user_id

The stable and unique string identifying the user. For more information about IDs, see IAM identifiers in the IAM User Guide.

user_detail_list[].user_name

The friendly name identifying the user.

user_detail_list[].user_policy_list[]
Show child fields
user_detail_list[].user_policy_list[].policy_document

The policy document.

user_detail_list[].user_policy_list[].policy_name

The name of the policy.