Files

3.2 KiB

page_title, subcategory, description
page_title subcategory description
kms_app_connection_ldap Resource - terraform-provider App Connections Create and manage LDAP App Connection

kms_app_connection_ldap (Resource)

Create and manage LDAP App Connection

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_app_connection_ldap" "ldap-demo" {
  name        = "ldap-demo"
  description = "This is a demo LDAP connection."
  method      = "simple-bind"
  credentials = {
    provider                = "active-directory"
    url                     = "ldap://ldap.example.com:389"
    dn                      = "cn=admin,dc=example,dc=com"
    password                = "<password>"
    ssl_reject_unauthorized = false
  }
}

# Example with LDAPS (secure LDAP)
resource "kms_app_connection_ldap" "ldap-demo-secure" {
  name        = "ldap-demo-secure"
  description = "This is a demo LDAP connection with SSL."
  method      = "simple-bind"
  credentials = {
    provider                = "active-directory"
    url                     = "ldaps://ldap.example.com:636"
    dn                      = "cn=admin,dc=example,dc=com"
    password                = "<password>"
    ssl_reject_unauthorized = true
    ssl_certificate         = file("${path.module}/ca.pem")
  }
}

Schema

Required

  • credentials (Attributes) The credentials for the LDAP App Connection (see below for nested schema)
  • method (String) The method used to authenticate with LDAP. Possible values are: simple-bind
  • name (String) The name of the LDAP App Connection to create. Must be slug-friendly

Optional

  • description (String) An optional description for the LDAP App Connection.
  • project_id (String) The ID of the project to scope the app connection to. If not provided, the app connection will be scoped to the organization.

Read-Only

  • credentials_hash (String) The hash of the LDAP App Connection credentials
  • id (String) The ID of the app connection

Nested Schema for credentials

Required:

  • dn (String) The Distinguished Name (DN) or User Principal Name (UPN) of the principal to bind with (e.g., 'CN=John,CN=Users,DC=example,DC=com').
  • password (String, Sensitive) The password to bind with for authentication.
  • provider (String) The LDAP provider (e.g., 'active-directory').
  • url (String) The LDAP server URL (e.g., 'ldap://example.com:389' or 'ldaps://example.com:636').

Optional:

  • ssl_certificate (String) The SSL certificate (PEM format) to use for secure connection when using ldaps:// with a self-signed certificate.
  • ssl_reject_unauthorized (Boolean) Whether or not to reject unauthorized SSL certificates (true/false) when using ldaps://. Set to false only in test environments.