Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Describe a policy in AWS using the CLI

It might seems a silly question but I'm not able and I haven't find any command to show in the aws CLI the policy body. I have a managed policy attached to a role. I can simply display the ID and other information but not the body. Am I missing anything?

I run

aws iam get-policy --policy-arn <arn>

and get something like:

{
    "Policy": {
        "PolicyName": "developer_allow",
        "CreateDate": "2017-03-28T12:57:11Z",
        "AttachmentCount": 1,
        "IsAttachable": true,
        "PolicyId": "XXXXXXXXXXXXXXXXXXXXX",
        "DefaultVersionId": "v1",
        "Path": "/",
        "Arn": "arn:aws:iam::xxxxxxxxxxx:policy/developer_allow",
        "UpdateDate": "2017-03-28T12:57:11Z"
    }
}
like image 541
Mazzy Avatar asked Dec 01 '25 00:12

Mazzy


1 Answers

It was slightly more complicated but here the command:

aws iam get-policy-version --policy-arn arn:aws:iam::XXXXXXXXXXXXXXX:policy/developer_allow --version-id v1

You need to specify the version

like image 60
Mazzy Avatar answered Dec 05 '25 08:12

Mazzy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!