Create a service user in your Vultr organization for API-only access. Provision an automated account with an API key for machine-to-machine communication.
Service users are API-only accounts designed for programmatic access to your organization's resources. Unlike regular users, service users do not require an invitation to join the organization and are created directly.
Follow this guide to create a service user using the Vultr Console or Terraform.
Log in to the Vultr Console.
Click the organization name in the top navigation bar.
Click Manage Organization.
Click the Users tab.
Click the + button to add a user.
In the Add User panel, select the User Type as Service User.
Enter the Service User Name and Email Address.
(Optional) Select Groups and Roles to assign to the service user.
Click Review and add.
Review the details and click Add service user.
The service user is created and appears in the Users list with a type of Service User.
api_enabled = true. Treat the state file as sensitive and restrict access accordingly.
Ensure the Vultr Terraform provider is configured in your Terraform project.
Define the service user resource. Replace SERVICE-USER-NAME, SERVICE-USER-EMAIL, and STRONG-PASSWORD with your values.
resource "vultr_user" "service_user" {
name = "SERVICE-USER-NAME"
email = "SERVICE-USER-EMAIL"
password = "STRONG-PASSWORD"
service_user = true
api_enabled = true
}
Apply the configuration.
$ terraform apply
Verify that the output shows vultr_user.service_user: Creation complete. The service user's API key is available in the Terraform state and can be retrieved with terraform show.