List all groups that have a specific IAM policy attached on Vultr. Identify which groups inherit permissions from a given policy through the Vultr IAM API.
Listing groups with a policy attached allows you to see which groups have the permissions defined by that policy. This is useful for auditing access configurations and understanding how a policy's permissions are distributed across your organization.
This guide explains how to list groups with a policy attached using the Vultr Console and the Vultr API.
Log in to the Vultr Console.
Click the organization name in the top navigation bar.
Click Manage Organization.
Click the Permission Policies tab.
Click the name of the policy you want to inspect.
Expand the Attached Entities section.
The table displays all users and groups attached to this policy, including their name, type, and status. Groups are identified by the Group type label.
Send a GET request to the List Policies endpoint to retrieve all policies in your organization.
$ curl "https://api.vultr.com/v2/policies" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Note the id of the policy for which you want to list groups.
Send a GET request to the List Groups with Policy endpoint to retrieve all groups assigned to the policy. Replace {policy-id} with the id of the policy.
$ curl "https://api.vultr.com/v2/policies/{policy-id}/groups" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
The response contains the requested resources.