How to Attach a Policy to a User

Updated on 01 June, 2026

Attach an IAM policy directly to a user on Vultr. Grant the user specific permissions defined in the policy document through the Vultr API or Console.


Attaching a policy directly to a user grants them the permissions defined in the policy's document. This is useful when a user needs specific permissions that are not covered by their group or role assignments.

Follow this guide to attach a policy to a user using the Vultr Console, the Vultr API, or Terraform.

  • Vultr Console
  • Vultr API
  • Terraform
  1. Log in to the Vultr Console.

  2. Click the organization name in the top navigation bar.

  3. Click Manage Organization.

  4. Click the Permission Policies tab.

  5. Click the name of the policy you want to attach.

  6. In the Attached Entities section, click the + button.

  7. Search for and select the users you want to attach to this policy.

  8. Click Attach Entities.

    The selected users appear in the Attached Entities list and inherit the policy's permissions.

  1. Send a GET request to the List Policies endpoint to retrieve all policies in your organization.

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

    Note the id of the policy you want to attach.

  2. Identify the user_id of the target user. Follow the steps in How to List All Users in an Organization to retrieve user IDs.

  3. Send a POST request to the Attach Policy to User endpoint to attach the policy. Replace {policy-id} with the policy id and {user-id} with the user id.

    console
    $ curl "https://api.vultr.com/v2/policies/{policy-id}/users/{user-id}" \
        -X POST \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    

    A successful request returns an HTTP 201 Created response.

  1. Ensure the Vultr Terraform provider is configured in your Terraform project.

  2. Define the policy-user attachment resource. Use Terraform references if the policy and user are managed in the same configuration, or replace with literal IDs.

    hcl
    resource "vultr_organization_policy_user_attachment" "policy-user-attachment" {
      policy_id = vultr_organization_policy.my_policy.id
      user_id   = vultr_user.new_user.id
    }
    
  3. Apply the configuration.

    console
    $ terraform apply
    

    Verify that the output shows vultr_organization_policy_user_attachment.policy-user-attachment: Creation complete.

Comments