Files

2.7 KiB

page_title, subcategory, description
page_title subcategory description
kms_project_user Resource - terraform-provider Projects Create project users & save to Hanzo KMS. Only Machine Identity authentication is supported for this resource

kms_project_user (Resource)

Create project users & save to Hanzo KMS. Only Machine Identity authentication is supported for this resource

Example Usage

terraform {
  required_providers {
    kms = {
      # version = <latest version>
      source = "hanzokms/kms"
    }
  }
}

provider "kms" {
  host = "https://kms.hanzo.ai" # Only required if using self hosted instance of Hanzo KMS, default is https://kms.hanzo.ai
  auth = {
    universal = {
      client_id     = "<machine-identity-client-id>"
      client_secret = "<machine-identity-client-secret>"
    }
  }
}

resource "kms_project" "example" {
  name = "example"
  slug = "example"
}

resource "kms_project_user" "test-user" {
  project_id = kms_project.example.id
  username   = "<username/email>"
  roles = [
    {
      role_slug = "admin"
    }
  ]
}

Schema

Required

  • project_id (String) The id of the project
  • roles (Attributes List) The roles assigned to the project user (see below for nested schema)
  • username (String) The usename of the user. By default its the email

Read-Only

  • membership_id (String) The membershipId of the project user
  • user (Attributes) The user details of the project user (see below for nested schema)

Nested Schema for roles

Required:

  • role_slug (String) The slug of the role

Optional:

  • custom_role_id (String) The id of the custom role slug
  • is_temporary (Boolean) Flag to indicate the assigned role is temporary or not. When is_temporary is true fields temporary_mode, temporary_range and temporary_access_start_time is required.
  • temporary_access_end_time (String) ISO time for which temporary access will end. Computed based on temporary_range and temporary_access_start_time
  • temporary_access_start_time (String) ISO time for which temporary access should begin. The current time is used by default.
  • temporary_mode (String) Type of temporary access given. Types: relative. Default: relative
  • temporary_range (String) TTL for the temporary time. Eg: 1m, 1h, 1d. Default: 1h

Read-Only:

  • id (String) The ID of the project user role.

Nested Schema for user

Read-Only:

  • email (String) The email of the user
  • first_name (String) The first name of the user
  • id (String) The id of the user
  • last_name (String) The last name of the user