Files

2.6 KiB

page_title, subcategory, description
page_title subcategory description
kms_app_connection_postgres Resource - terraform-provider App Connections Create and manage PostgreSQL App Connection

kms_app_connection_postgres (Resource)

Create and manage PostgreSQL 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_postgres" "postgres-demo" {
  name        = "postgres-demo"
  description = "This is a demo postgres connection."
  method      = "username-and-password"
  credentials = {
    host        = "example.com"
    port        = 5432
    database    = "default"
    username    = "postgres"
    password    = "<password>"
    ssl_enabled = false
  }
}

Schema

Required

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

Optional

  • description (String) An optional description for the PostgreSQL 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 PostgreSQL App Connection credentials
  • id (String) The ID of the app connection

Nested Schema for credentials

Required:

  • database (String) The name of the database to connect to.
  • host (String) The hostname of the database server.
  • password (String, Sensitive) The password to connect to the database with.
  • username (String) The username to connect to the database with.

Optional:

  • port (Number) The port number of the database.
  • ssl_certificate (String) The SSL certificate to use for connection.
  • ssl_enabled (Boolean) Whether or not to use SSL when connecting to the database.
  • ssl_reject_unauthorized (Boolean) Whether or not to reject unauthorized SSL certificates.