Files

2.7 KiB

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

kms_project (Resource)

Create projects & 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" "gcp-project" {
  name        = "GCP Project"
  slug        = "gcp-project"
  description = "This is a GCP project"
  type        = "secret-manager" # Default project type
}

resource "kms_project" "aws-project" {
  name        = "AWS Project"
  slug        = "aws-project"
  description = "This is an AWS project"
  type        = "secret-manager"
}

resource "kms_project" "kms-project" {
  name        = "KMS Project"
  slug        = "kms-project"
  description = "This is a KMS project for key management"
  type        = "kms"
}

resource "kms_project" "certificate-project" {
  name        = "Certificates Project"
  slug        = "certificate-project"
  description = "This is a certificates project for certificate management"
  type        = "cert-manager"
}

Schema

Required

  • name (String) The name of the project
  • slug (String) The slug of the project

Optional

  • audit_log_retention_days (Number) The audit log retention in days
  • description (String) The description of the project
  • has_delete_protection (Boolean) Whether the project has delete protection, defaults to false
  • kms_secret_manager_key_id (String) The ID of the KMS secret manager key to use for the project
  • should_create_default_envs (Boolean) Whether to create default environments for the project (dev, staging, prod), defaults to true
  • template_name (String) The name of the template to use for the project
  • type (String) The type of the project. Supported values: secret-manager, cert-manager, kms. Defaults to 'secret-manager'.

Read-Only

  • id (String) The ID of the project
  • last_updated (String)

Import

Import is supported using the following syntax:

# This will import the project by the project ID
terraform import kms_project.example <project_id>