There are more AWS SDK examples available in the AWS Doc SDK Examples
Use ListPolicyVersions
with a CLI
The following code examples show how to use ListPolicyVersions
.
Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code examples:
- AWS CLI
-
To list information about the versions of the specified managed policy
This example returns the list of available versions of the policy whose ARN is
arn:aws:iam::123456789012:policy/MySamplePolicy
.aws iam list-policy-versions \ --policy-arn
arn:aws:iam::123456789012:policy/MySamplePolicy
Output:
{ "IsTruncated": false, "Versions": [ { "VersionId": "v2", "IsDefaultVersion": true, "CreateDate": "2015-06-02T23:19:44Z" }, { "VersionId": "v1", "IsDefaultVersion": false, "CreateDate": "2015-06-02T22:30:47Z" } ] }
For more information, see Policies and permissions in IAM in the AWS IAM User Guide.
-
For API details, see ListPolicyVersions
in AWS CLI Command Reference.
-