Exo / Show Iam Role Policy
Show Iam Role Policy
Show detailed IAM role policies using the Exo CLI and format the output using jq.
exo iam role show <iam_role_name> --policy -O <json> | jq . exo iam role show <iam_role_name> --policy -O <json> | jq . #!/bin/bash
# Show Iam Role Policy
exo iam role show {{iam_role_name}} --policy {{[-O|--output-format]}} {{json}} | jq . When To Use
When auditing existing IAM role policies for security reviews or compliance checks.
Pro Tip
Combine with `--policy` to view inline policies; use `--verbose` for additional debugging information regarding role policies.
Command Builder
Tune the command before you copy it
exo iam role show <iam_role_name> --policy -O <json> | jq . Anatomy of Output
Understanding the result
Role Name: UserRole | Policy Version: 2012-10-17 | Policy Document: { ... } Policy Summary Provides an overview of the role and its associated policy.
Statement: Allow | Resource: * Statement Details Indicates what actions are allowed on what resources.
Last Updated: 2023-10-01 Last Update Info Indicates the last modification date of the policy.
Troubleshooting
Common pitfalls
Error: Role not found.
Solution: Confirm the IAM role name is correct and exists in your account.
Error: Access denied.
Solution: Verify that your permissions include 'iam:GetRolePolicy' for the specified role.
Error: Invalid output format specified.
Solution: Use either 'json' or 'table' as valid output formats.
Command Breakdown
What each part is doing
-
exo - Base Command
- The executable that performs this operation. Here it runs Exo before the shell applies any redirect operators.
-
<iam_role_name> - iam role name
- The value supplied for iam role name.
-
-O - O| output format
- The value supplied for O| output format.
-
<json> - json
- The value supplied for json.
-
--policy - Command Option
- Tool-specific option used by this command invocation.
-
-O - Command Option
- Tool-specific option used by this command invocation.
Alternative Approaches
Comparable commands in other tools
Alternative cloud infrastructure tools for the same job.
flyctl status --app <app_name> Ansible Inventory / Dump Default Inventory To File ansible-inventory --list --output <path/to/file> Ansible / List Groups In Inventory ansible localhost -m debug -a '<var=groups.keys()>' Aws / List Indexes aws kendra list-indexes Aws / Describe Index aws kendra describe-index --id <index_id>