aws.iam.list_policies
Example SQL Queries
SELECT * FROMaws.iam.list_policies;Description
Lists all the managed policies that are available in your Amazon Web Services account, including your own customer-defined managed policies and all Amazon Web Services managed policies.
You can filter the list of policies that is returned using the optional OnlyAttached, Scope, and PathPrefix parameters. For example, to list only the customer managed policies in your Amazon Web Services account, set Scope to Local. To list only Amazon Web Services managed policies, set Scope to AWS.
You can paginate the results using the MaxItems and Marker parameters.
For more information about managed policies, see Managed policies and inline policies in the IAM User Guide.
IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a customer manged policy, see GetPolicy.
Table Definition
| Column Name | Column Data Type |
|---|---|
| only_attached Input Column A flag to filter the results to only the attached policies. When OnlyAttached is true, the returned list contains only the policies that are attached to an IAM user, group, or role. When OnlyAttached is false, or when the parameter is not included, all policies are returned. | BOOLEAN |
| path_prefix Input Column The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all policies. This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F), including most punctuation characters, digits, and upper and lowercased letters. | VARCHAR |
| policy_usage_filter Input Column The policy usage method to use for filtering the results. To list only permissions policies, set PolicyUsageFilter to PermissionsPolicy. To list only the policies used to set permissions boundaries, set the value to PermissionsBoundary. This parameter is optional. If it is not included, all policies are returned. | VARCHAR |
| scope Input Column The scope to use for filtering the results. To list only Amazon Web Services managed policies, set Scope to AWS. To list only the customer managed policies in your Amazon Web Services account, set Scope to Local. This parameter is optional. If it is not included, or if it is set to All, all policies are returned. | VARCHAR |
| _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( |
Show child fields
| |
| 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. | VARCHAR |
| attachment_count The number of entities (users, groups, and roles) that the policy is attached to. | BIGINT |
| create_date The date and time, in ISO 8601 date-time format, when the policy was created. | TIMESTAMP_S |
| default_version_id The identifier for the version of the policy that is set as the default version. | VARCHAR |
| description A friendly description of the policy. This element is included in the response to the GetPolicy operation. It is not included in the response to the ListPolicies operation. | VARCHAR |
| is_attachable Specifies whether the policy can be attached to an IAM user, group, or role. | BOOLEAN |
| path The path to the policy. For more information about paths, see IAM identifiers in the IAM User Guide. | VARCHAR |
| permissions_boundary_usage_count The number of entities (users and roles) for which the policy is used to set the permissions boundary. For more information about permissions boundaries, see Permissions boundaries for IAM identities in the IAM User Guide. | BIGINT |
| policy_id The stable and unique string identifying the policy. For more information about IDs, see IAM identifiers in the IAM User Guide. | VARCHAR |
| policy_name The friendly name (not ARN) identifying the policy. | VARCHAR |
| tags A list of tags that are attached to the instance profile. For more information about tagging, see Tagging IAM resources in the IAM User Guide. | STRUCT( |
Show child fields
| |
| 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. | TIMESTAMP_S |