delphix-integrations / terraform-provider-delphix

Repository for Delphix Terraform Provider built on DCT APIs.
https://integrations.delphix.com
11 stars 9 forks source link

HUBS-1559 | Postgres (Appdata) support #53

Closed Uddipaan-Hazarika closed 1 year ago

Uddipaan-Hazarika commented 1 year ago

Problem:

We didnt support appdata plugin in provider.

Solution:

added appdata provision parameters.

Testing

Tried with Postgre and Hana and all 3 methods of provisioning for both databases. HANA:

terraform {
  required_providers {
    delphix = {
      version = "2.0.0-beta"
      source  = "delphix.com/local/delphix"
    }
  }
}

provider "delphix" {
  tls_insecure_skip = true
  key               = KEY
  host              = URL
}

resource "delphix_vdb" "test_hana_tf_snpsht" {
  provision_type          = "snapshot"
  auto_select_repository  = true
  environment_id          = "5-UNIX_HOST_ENVIRONMENT-1"
  source_data_id          = "4-APPDATA_CONTAINER-16"
  snapshot_id             = "5-APPDATA_SNAPSHOT-1"
  name                    = "test_hana_tf_snpsht"

  appdata_source_params = jsonencode({
    mountLocation    = "/mnt/snpsht"
     configServices = [{
        "sTenantServicePort" =  "indexserver:30055"
      },
      {
        "sTenantServicePort" =  "xsengine:30058"
      }]
    tDatabaseName   = "tfsnpsht"
    tSystemUserName ="SYSTEM"
    tSystemUserPassword ="Delphix_123"
  })
}

POSTGRES:

terraform {
  required_providers {
    delphix = {
      version = "2.0.0-beta"
      source  = "delphix.com/local/delphix"
    }
  }
}

provider "delphix" {
  tls_insecure_skip = true
  key               = KEY
  host              = URL
}

resource "delphix_vdb" "test_postgres_tf_tmstmp" {
  provision_type          = "timestamp"
  timestamp               = "2023-05-02T17:59:43.587Z"
  auto_select_repository  = true
  environment_id          = "4-UNIX_HOST_ENVIRONMENT-8"
  source_data_id          = "4-APPDATA_CONTAINER-8"
  name                    = "test_postgres_tf_tmstmp"

  appdata_source_params = jsonencode({
    mountLocation       = "/mnt/tmstmp"
    postgresPort        = 5436
    configSettingsStg   = [{ propertyName: "timezone", value:"GMT", commentProperty:false}]
    })
}