aws iam get-policy-version
Retrieves information about the specified version of the specified managed policy, including the policy document. AWS CLI reference
1 example 2 options Its page in the AWS CLI reference
Examples
To retrieve information about the specified version of the specified managed policy
The following get-policy-version example returns the policy document for the v2 version of the policy whose ARN is arn:aws:iam::123456789012:policy/MyManagedPolicy.
aws iam get-policy-version --policy-arn arn:aws:iam::123456789012:policy/MyPolicy --version-id v2Identify--policy-arnThe Amazon Resource Name (ARN) of the managed policy that you want information about.--version-idIdentifies the policy version to retrieve.Its output
{
"PolicyVersion": {
"Document": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:*",
"Resource": "*"
}
]
},
"VersionId": "v2",
"IsDefaultVersion": true,
"CreateDate": "2023-04-11T00:22:54+00:00"
}
}For more information, see Policies and permissions in IAM in the AWS IAM User Guide.
Options
--policy-arnThe Amazon Resource Name (ARN) of the managed policy that you want information about.--version-idIdentifies the policy version to retrieve.