---
title: How to Attach a Role to a Group
url: https://docs.vultr.com/platform/iam/roles/how-to-attach-a-role-to-a-group
description: Attach an IAM role to a group on Vultr. All members of the group inherit the permissions from the role's attached policies through the Vultr IAM system.
publish_date: 2026-03-24T19:52:35.872736Z
last_updated: 2026-06-01T21:29:26.294293Z
---

Attaching a role to a group grants all members of the group the permissions defined by the policies within that role. This simplifies access management by allowing you to control permissions at the group level.

Follow this guide to attach a role to a group using the Vultr Console, the Vultr API, or Terraform.

=== "Vultr Console"

    1. Log in to the [Vultr Console](https://console.vultr.com).
    1. Click the organization name in the top navigation bar.
    1. Click **Manage Organization**.
    1. Click the **Groups** tab.
    1. Click the name of the group to which you want to attach the role.
    1. In the **Roles** section, click the **+** button.
    1. Search and select the roles you want to attach.
    1. Click **Add Selected**.

        The selected roles appear in the Roles section and all group members inherit the associated permissions.

=== "Vultr API"

    1. Send a `GET` request to the [**List Roles** endpoint](https://www.vultr.com/api/#tag/iam/operation/list-iam-roles) to retrieve all roles in your organization.

        ```console
        $ curl "https://api.vultr.com/v2/roles" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

        Note the `id` of the role you want to attach.

    1. Send a `GET` request to the [**List Groups** endpoint](https://www.vultr.com/api/#tag/iam/operation/list-iam-groups) to retrieve all groups.

        ```console
        $ curl "https://api.vultr.com/v2/groups" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

        Note the `id` of the group to which you want to attach the role.

    1. Send a `POST` request to the [**Attach Role to Group** endpoint](https://www.vultr.com/api/#tag/iam/operation/assign-iam-group-to-role) to attach the role. Replace `{role-id}` with the role id and `{group-id}` with the group id.

        ```console
        $ curl "https://api.vultr.com/v2/roles/{role-id}/groups/{group-id}" \
            -X POST \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

        A successful request returns an HTTP `201 Created` response.

=== "Terraform"

    > [!NOTE]
    > Only roles with `type = "assignable"` can be attached to groups. Assumable roles cannot be attached to groups.

    1. Ensure the [Vultr Terraform provider](https://registry.terraform.io/providers/vultr/vultr/latest/docs) is configured in your Terraform project.

    1. Define the role-group attachment resource. Use Terraform references if the role and group are managed in the same configuration, or replace with literal IDs.

        ```hcl
        resource "vultr_organization_role_group_attachment" "role-group-attachment" {
          role_id  = vultr_organization_role.my_role.id
          group_id = vultr_organization_group.my_group.id
        }
        ```

    1. Apply the configuration.

        ```console
        $ terraform apply
        ```

        Verify that the output shows `vultr_organization_role_group_attachment.role-group-attachment: Creation complete`.