Files

2.7 KiB

page_title, subcategory, description
page_title subcategory description
kms_project_identity Resource - terraform-provider Projects Create project identities & save to Hanzo KMS. Only Machine Identity authentication is supported for this data source

kms_project_identity (Resource)

Create project identities & save to Hanzo KMS. Only Machine Identity authentication is supported for this data source

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_identity" "test-identity" {
  project_id  = kms_project.example.id
  identity_id = "<identity id>"
  roles = [
    {
      role_slug = "admin"
    }
  ]
}

Schema

Required

  • identity_id (String) The id of the identity.
  • project_id (String) The id of the project
  • roles (Attributes List) The roles assigned to the project identity (see below for nested schema)

Read-Only

  • identity (Attributes) The identity details of the project identity (see below for nested schema)
  • membership_id (String) The membership Id of the project identity

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 identity role.

Nested Schema for identity

Read-Only:

  • auth_methods (List of String) The auth methods for the identity
  • id (String) The ID of the identity
  • name (String) The name of the identity