Skip to content

Latest commit

 

History

History
109 lines (89 loc) · 3.36 KB

File metadata and controls

109 lines (89 loc) · 3.36 KB
page_title forgejo_user Resource - forgejo
subcategory
description Forgejo user resource. Note: Managing users requires administrative privileges!

forgejo_user (Resource)

Forgejo user resource.

Note: Managing users requires administrative privileges!

Example Usage

terraform {
  required_providers {
    forgejo = {
      source = "svalabs/forgejo"
    }
  }
}

variable "test_password" { sensitive = true }

provider "forgejo" {
  host = "http://localhost:3000"
}

# User with default settings
resource "forgejo_user" "defaults" {
  login    = "test_user_defaults"
  email    = "test_user_defaults@localhost.localdomain"
  password = var.test_password
}

# User with custom settings
resource "forgejo_user" "non_defaults" {
  login       = "test_user_non_defaults"
  email       = "test_user_non_defaults@localhost.localdomain"
  password    = var.test_password
  full_name   = "Terraform Test User with non-default attributes"
  description = "Purely for testing..."
  website     = "https://forgejo.org/"
  location    = "Mêlée Island"
  visibility  = "private"
}

# Import user
# id follows the format: <login>
import {
  id = "test_user_defaults"
  to = forgejo_user.defaults
}

Schema

Required

  • email (String) Email address of the user.
  • login (String) Name of the user. Changing this forces a new resource to be created.
  • password (String, Sensitive) Password of the user.

Optional

  • active (Boolean) Is the user active?
  • admin (Boolean) Is the user an administrator?
  • allow_create_organization (Boolean) Allow user to create organizations?
  • allow_git_hook (Boolean) Allow user to create Git hooks?
  • allow_import_local (Boolean) Allow user to import local repositories?
  • deactivate_on_destroy (Boolean) Deactivate the user instead of delete?
  • description (String) Description of the user.
  • full_name (String) Full name of the user.
  • location (String) Location of the user.
  • login_name (String) Login name of the user.
  • max_repo_creation (Number) Maximum number of repositories user can create. A value of -1 means no limit.
  • must_change_password (Boolean) Require user to change password?
  • prohibit_login (Boolean) Are user logins prohibited?
  • restricted (Boolean) Is the user restricted?
  • send_notify (Boolean) Send notification to administrators? Changing this forces a new resource to be created.
  • source_id (Number) Numeric identifier of the user's authentication source.
  • visibility (String) Visibility of the user. Possible values are 'public' (default), 'limited', or 'private'.
  • website (String) Website of the user.

Read-Only

  • avatar_url (String) Avatar URL of the user.
  • created_at (String) Time at which the user was created.
  • followers_count (Number) Number of following users.
  • following_count (Number) Number of users followed.
  • html_url (String) URL to the user's profile page.
  • id (Number) Numeric identifier of the user.
  • language (String) Locale of the user.
  • last_login (String) Time at which the user last logged in.
  • starred_repos_count (Number) Number of starred repositories.

Import

Import is supported using the following syntax:

# Import using the users login.
terraform import forgejo_user.defaults test_user_defaults