| page_title | coderd_user Resource - terraform-provider-coderd |
|---|---|
| subcategory | |
| description | A user on the Coder deployment. |
A user on the Coder deployment.
// Provider populated from environemnt variables
provider "coderd" {}
// Create a bot user for Jenkins
resource "coderd_user" "jenkins" {
username = "jenkins"
name = "Jenkins CI/CD"
email = "ci@example.com"
roles = ["template-admin"]
login_type = "none"
}
// Keep the password of a user account up to date from an external source
resource "coderd_user" "audit" {
username = "auditor"
name = "Auditor"
email = "security@example.com"
roles = ["auditor"]
login_type = "password"
password = data.vault_password.auditor.value
}
// Ensure the admin account is suspended
resource "coderd_user" "admin" {
username = "admin"
suspended = true
email = "admin@example.com"
}email(String) Email address of the user.username(String) Username of the user.
login_type(String) Type of login for the user. Valid types arenone,password,github, andoidc.name(String) Display name of the user. Defaults to username.password(String, Sensitive) Password for the user. Required whenlogin_typeispassword. Passwords are saved into the state as plain text and should only be used for testing purposes.roles(Set of String) Roles assigned to the user. Valid roles areowner,template-admin,user-admin, andauditor. Ifnull, roles will not be managed by Terraform. This attribute must be null if the user is an OIDC user and role sync is configuredsuspended(Boolean) Whether the user is suspended.
id(String) User ID
Import is supported using the following syntax:
The terraform import command can be used, for example:
# The ID supplied can be either a user UUID retrieved via the API
# or a username.
$ terraform import coderd_user.example developerAlternatively, in Terraform v1.5.0 and later, an import block can be used:
import {
to = coderd_user.example
id = "developer"
}