diff --git a/docs/guides/provider_guide.md b/docs/guides/provider_guide.md new file mode 100644 index 0000000..783cab5 --- /dev/null +++ b/docs/guides/provider_guide.md @@ -0,0 +1,6 @@ +# Guide: Delphix Provider Guide + +## Delphix Provider Guide +[We have provided a handful of examples in our GitHub repository to help you get a jump start with our Delphix Provider.](https://github.com/delphix-integrations/terraform-provider-delphix/tree/main/examples) These examples range from Terraform resource templates, quick Terraform examples, and full Jenkins pipelines. We update this repository based on our implementation experience, so be sure to check back for updates! + +If you have a suggested template, request, or modification, please submit it in our [GitHub Issues section.](https://github.com/delphix-integrations/terraform-provider-delphix) diff --git a/examples/jenkins-integration/Readme.md b/examples/jenkins-integration/Readme.md new file mode 100644 index 0000000..c7ca588 --- /dev/null +++ b/examples/jenkins-integration/Readme.md @@ -0,0 +1,21 @@ +### Summary +The Jenkinsfile presents a simple CI/CD scenario where it provisions a VDB, runs an automated test (like Selenium or JUnit) against that application & dataset, and then destroys the VDB. On testing failure, which will happen every time, a bookmark is created. This Jenksinfile leverages the DCT Terrafrom Provider and an API Curl command to show the full breadth of possibilites. All other steps are mocked out. + +### Simple Getting Stated +1) Create a Jenkinsfile Pipeline Job +2) Insert or reference the associated `Jenkinsfile` file. + - Note: This Jenkinsfile also references the Terraform files in the `../simple-provision` folder. Feel free to fork, update, and modify those. +3) Update the following values: + - DCT_HOSTNAME - Example: `123.0.0.0` + - DCT_API_KEY - Example: `2.abc...` + - [Manage this value through the Jenkins' Credentials plugin](https://docs.cloudbees.com/docs/cloudbees-ci/latest/cloud-secure-guide/injecting-secrets) + - In a pinch, update it directly. + - SOURCE_VDB - Example: `Oracle_QA` +4) Run Jenkins Job + +Note: I suggest you reduce the sleep timers in early testing scenarios . + + +### Known Issues +On VDB destroy, the underlying Bookmark's snapshot will be deleted and the Bookmark will become "dangling". +Instead, I recommend using an "Enable/Disable" command instead of "Provision/Destroy" or skip the destroy VDB on failure. \ No newline at end of file diff --git a/examples/jenkins-integration/jenkinsfile b/examples/jenkins-integration/jenkinsfile new file mode 100644 index 0000000..930d12d --- /dev/null +++ b/examples/jenkins-integration/jenkinsfile @@ -0,0 +1,175 @@ +pipeline { + agent any + + environment { + def provision_successful = false + def vdb_id = "" + def vdb_name = "" + def DCT_HOSTNAME = "" + def SOURCE_VDB = "" + test_error = 'false' + } + + stages { + + stage ('Build Application') { + steps { + echo ('Building...') + sleep (50) + } + } + + stage ('Stand Up Full Application') { + parallel { + stage ('Apply Application Install') { + steps{ + echo ('Provisioning Test App...') + sleep (30) + } + } + stage ('Create Database w/ Terraform') { + steps { + script { + echo ('Provisioning VDB...') + git branch: 'main', changelog: false, poll: false, url: 'https://github.com/delphix-integrations/terraform-provider-delphix.git' + // sh ('ls -R') + sh ('terraform -chdir=examples/simple-provision init') + withCredentials([string(credentialsId: 'DCT_API_KEY', variable: 'KEY')]) { + sh ('terraform -chdir=examples/simple-provision apply -var="source_data_id_1=$SOURCE_VDB" -var="dct_hostname=$DCT_HOSTNAME" -var="dct_api_key=$KEY" -auto-approve') + } + vdb_id = sh(script: 'terraform -chdir=examples/simple-provision output vdb_id_1', returnStdout: true) + vdb_id = vdb_id.replaceAll('\\"', "").trim() + vdb_name = sh(script: 'terraform -chdir=examples/simple-provision output vdb_name_1', returnStdout: true) + echo ("vdb_id:" + vdb_id) + echo ("vdb_name:" + vdb_name) + provision_successful = true + } + } + } + } + } + + stage ('Combine') { + steps { + echo ('Combining...') + sleep (10) + } + } + + stage ('Run Tests') { + parallel { + stage ('UI') { + stages { + stage ('Run UI Tests') { + steps{ + echo ('UI Tests...') + sleep (150) + } + } + stage ('Send UI Test Results') { + steps{ + echo ('Send UI Test Results...') + sleep (5) + } + } + } + } + stage ('Unit') { + stages { + stage ('Run Unit Tests') { + steps { + script { + echo ('Unit Tests...') + sleep (70) + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + echo ('Identified 7 failing Unit Tests!') + test_error = 'true'; + sh "exit 1" + } + } + } + } + stage ('Send Unit Test Results') { + steps{ + echo ('Send Unit Test Results...') + sleep (6) + } + } + } + } + stage ('Integ.') { + stages { + stage ('Run Integration Tests') { + steps{ + echo ('UI Tests...') + sleep (130) + } + } + stage ('Send Integration Test Results') { + steps{ + echo ('Send Integration Test Results...') + sleep (4) + } + } + } + } + } + } + + stage ('Bookmark Database') { + when { + equals expected: 'true', actual: test_error + } + steps{ + script { + echo ('Bookmark VDB... ') + withCredentials([string(credentialsId: 'DCT_API_KEY', variable: 'KEY')]) { + sh """ + curl -X 'POST' -k \ + 'https://$DCT_HOSTNAME/v3/bookmarks' \ + -H 'accept: application/json' \ + -H 'Authorization: apk ${KEY}' \ + -H 'Content-Type: application/json' \ + -d '{ + "name": "JKNS-BOOKMARK-$BUILD_NUMBER", + "vdb_ids": [ + "${vdb_id}" + ], + "retain_forever": true, + "make_current_account_owner": true + }' + """ + } + } + } + } + + stage ('Destroy Full Application') { + parallel { + stage ('Destroy Application') { + steps { + script { + echo ('Destroying Application...') + sleep (30) + } + } + } + stage ('Destroy Database w/ Terraform') { + steps { + script { + if (provision_successful) { + sleep (60) + echo ('Destroying Test App and VDB...') + withCredentials([string(credentialsId: 'DCT_API_KEY', variable: 'KEY')]) { + sh ('terraform -chdir=examples/simple-provision destroy -var="source_data_id_1=$SOURCE_VDB" -var="dct_hostname=$DCT_HOSTNAME" -var="dct_api_key=$KEY" -auto-approve') + } + } else { + echo ('No App or VDB to destroy...') + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/examples/simple-provision/README.md b/examples/simple-provision/README.md new file mode 100644 index 0000000..01cda7f --- /dev/null +++ b/examples/simple-provision/README.md @@ -0,0 +1,28 @@ + +### Simple Getting Stated + +1) Update the dct_hostname and dct_api_key variables in the `variables.tf` or in Terrafrom Cloud with the DCT Server and API Key. +For example: +- DCT: uv123abcfei59h6qajyy.vm.cld.sr +- API Key: 2.ZAAgpjHxljW7A7g... + +2) Update `Oracle_QA` with an applicable VDB name and run the following commands. +``` +# Create all resources +terraform apply -var="source_data_id_1=Oracle_QA" + +# Destroy resources +terraform destroy" +``` + + +### Troubleshoot: Invalid Resource State + +If you find that you've lost the sync between DCT and Terraform, use the `terraform state rm` command to help reconfigure without starting over. +``` +terraform state rm delphix_vdb.provision_vdb_1 + +terraform state rm delphix_vdb_group.create_vdb_group +``` + +[Documentation](https://developer.hashicorp.com/terraform/cli/commands/state/rm) diff --git a/examples/simple-provision/main.tf b/examples/simple-provision/main.tf new file mode 100644 index 0000000..431f1ff --- /dev/null +++ b/examples/simple-provision/main.tf @@ -0,0 +1,21 @@ +# Configure the connection to Data Control Tower +provider "delphix" { + host = var.dct_hostname + key = var.dct_api_key + tls_insecure_skip = true +} + +# Provision a VDB 1 +resource "delphix_vdb" "provision_vdb_1" { + name = "tfmtest1" + source_data_id = var.source_data_id_1 + auto_select_repository = true +} + +# Create a VDB Group with VDB 1 +resource "delphix_vdb_group" "create_vdb_group" { + name = "Terraform Demo Group" + vdb_ids = [ + delphix_vdb.provision_vdb_1.id + ] +} \ No newline at end of file diff --git a/examples/simple-provision/outputs.tf b/examples/simple-provision/outputs.tf new file mode 100644 index 0000000..8a868d3 --- /dev/null +++ b/examples/simple-provision/outputs.tf @@ -0,0 +1,33 @@ +### +# VDB Group Information +### +output "vdb_group_id" { + value = delphix_vdb_group.create_vdb_group.id +} + +output "vdb_group_name" { + value = delphix_vdb_group.create_vdb_group.name +} + +### +# VDB 1 Information +### +output "vdb_id_1" { + value = delphix_vdb.provision_vdb_1.id +} + +output "vdb_name_1" { + value = delphix_vdb.provision_vdb_1.name +} + +output "vdb_ip_address_1" { + value = delphix_vdb.provision_vdb_1.ip_address +} + +output "vdb_database_type_1" { + value = delphix_vdb.provision_vdb_1.database_type +} + +output "vdb_database_version_1" { + value = delphix_vdb.provision_vdb_1.database_version +} diff --git a/examples/simple-provision/variables.tf b/examples/simple-provision/variables.tf new file mode 100644 index 0000000..a2535e0 --- /dev/null +++ b/examples/simple-provision/variables.tf @@ -0,0 +1,13 @@ +variable "dct_hostname" { + type = string + description = "dct hostname config file [default: workspace variable set]" +} + +variable "dct_api_key" { + type = string + description = "dct api key config file [default: workspace variable set]" +} + +variable "source_data_id_1" { + description = "Name or ID of the VDB or Data Source to provision from. [User Defined]" +} \ No newline at end of file diff --git a/examples/simple-provision/versions.tf b/examples/simple-provision/versions.tf new file mode 100644 index 0000000..46085a0 --- /dev/null +++ b/examples/simple-provision/versions.tf @@ -0,0 +1,8 @@ +terraform { + required_providers { + delphix = { + source = "delphix-integrations/delphix" + version = "1.0.0" + } + } +} \ No newline at end of file diff --git a/examples/vdb/hana/bookmark/main.tf b/examples/vdb/hana/bookmark/main.tf new file mode 100644 index 0000000..cf4ada6 --- /dev/null +++ b/examples/vdb/hana/bookmark/main.tf @@ -0,0 +1,144 @@ +/** +* Summary: This template showcases the properties available when provisioning a SAP Hana database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + bookmark_id = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + repository_id = "" + appdata_source_params = jsonencode({ + mountLocation = "/mnt/bkmrk" + configServices = [{ + "sTenantServicePort" = "indexserver:30049" + }, + { + "sTenantServicePort" = "xsengine:30052" + }] + tDatabaseName = "tfbkmrk" + tSystemUserName = "" + tSystemUserPassword ="" + }) + config_params jsonencode({ + processes = 150 + }) + appdata_config_params jsonencode({ + param = "value" + }) + additional_mount_points = [{ + shared_path = "/", + mount_path = "/work", + environment_id = "environment-123" + }] + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file diff --git a/examples/vdb/hana/snapshot/main.tf b/examples/vdb/hana/snapshot/main.tf new file mode 100644 index 0000000..f5a8019 --- /dev/null +++ b/examples/vdb/hana/snapshot/main.tf @@ -0,0 +1,146 @@ +/** +* Summary: This template showcases the properties available when provisioning a SAP Hana database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + snapshot_id = "snapshot-id" + name = "vdb_to_be_created" + engine_id = "1" + source_data_id = "dsource-name" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + repository_id = "" + appdata_source_params = jsonencode({ + mountLocation = "/mnt/bkmrk" + configServices = [{ + "sTenantServicePort" = "indexserver:30049" + }, + { + "sTenantServicePort" = "xsengine:30052" + }] + tDatabaseName = "tfbkmrk" + tSystemUserName = "" + tSystemUserPassword ="" + }) + config_params jsonencode({ + processes = 150 + }) + appdata_config_params jsonencode({ + param = "value" + }) + additional_mount_points = [{ + shared_path = "/", + mount_path = "/work", + environment_id = "environment-123" + }] + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } + +} \ No newline at end of file diff --git a/examples/vdb/hana/timestamp/main.tf b/examples/vdb/hana/timestamp/main.tf new file mode 100644 index 0000000..26711ba --- /dev/null +++ b/examples/vdb/hana/timestamp/main.tf @@ -0,0 +1,146 @@ +/** +* Summary: This template showcases the properties available when provisioning an SAP Hana database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + timestamp = "" + timestamp_in_database_timezone = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + engine_id = "1" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + repository_id = "" + appdata_source_params = jsonencode({ + mountLocation = "/mnt/bkmrk" + configServices = [{ + "sTenantServicePort" = "indexserver:30049" + }, + { + "sTenantServicePort" = "xsengine:30052" + }] + tDatabaseName = "tfbkmrk" + tSystemUserName = "" + tSystemUserPassword ="" + }) + config_params jsonencode({ + processes = 150 + }) + appdata_config_params jsonencode({ + param = "value" + }) + additional_mount_points = [{ + shared_path = "/", + mount_path = "/work", + environment_id = "environment-123" + }] + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file diff --git a/examples/vdb/mssql/bookmark/main.tf b/examples/vdb/mssql/bookmark/main.tf new file mode 100644 index 0000000..4c13390 --- /dev/null +++ b/examples/vdb/mssql/bookmark/main.tf @@ -0,0 +1,140 @@ +/** +* Summary: This template showcases the properties available when provisioning a MSSQL database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + bookmark_id = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + cdc_on_provision = true + repository_id = "" + recovery_model = "" + config_params jsonencode({ + processes = 150 + }) + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_script { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_script { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file diff --git a/examples/vdb/mssql/snapshot/main.tf b/examples/vdb/mssql/snapshot/main.tf new file mode 100644 index 0000000..5b953ca --- /dev/null +++ b/examples/vdb/mssql/snapshot/main.tf @@ -0,0 +1,142 @@ +/** +* Summary: This template showcases the properties available when provisioning a MSSQL database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + snapshot_id = "snapshot-id" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + engine_id = "1" + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + cdc_on_provision = true + repository_id = "" + recovery_model = "" + config_params jsonencode({ + processes = 150 + }) + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_script { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_script { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } + +} \ No newline at end of file diff --git a/examples/vdb/mssql/timestamp/main.tf b/examples/vdb/mssql/timestamp/main.tf new file mode 100644 index 0000000..5c72226 --- /dev/null +++ b/examples/vdb/mssql/timestamp/main.tf @@ -0,0 +1,143 @@ +/** +* Summary: This template showcases the properties available when provisioning a MSSQL database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + timestamp = "" + timestamp_in_database_timezone = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + engine_id = "1" + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + recovery_model = "" + cdc_on_provision = true + repository_id = "" + + config_params jsonencode({ + processes = 150 + }) + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_script { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_script { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file diff --git a/examples/vdb/oracle/bookmark/main.tf b/examples/vdb/oracle/bookmark/main.tf new file mode 100644 index 0000000..eb548f3 --- /dev/null +++ b/examples/vdb/oracle/bookmark/main.tf @@ -0,0 +1,158 @@ +/** +* Summary: This template showcases the properties available when provisioning an Oracle database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + bookmark_id = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + os_username = "os-user-x" + os_password = "os-password-x" + vdb_restart = true + environment_id = "oracle-env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + open_reset_logs = true + archive_log = true + online_log_groups = 2 + snapshot_policy_id = "test_snapshot_policy" + unique_name = "dbdhcp2" + online_log_size = 4 + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$ORACLE_HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + file_mapping_rules = "/datafile/dbdhcp3/oradata/dbdhcp3:/data\n/u03/app/ora11202/product/11.2.0/dbhome_1/dbs/dbv_R2V4.dbf:/data/dbv_R2V4.dbf" + new_dbid = true + cluster_node_ids = ["ORACLE_CLUSTER_NODE-ID"] + auxiliary_template_id = "aux-template-1" + oracle_instance_name = "dbdhcp2" + retention_policy_id = "test_retention_policy" + template_id = "template-1" + repository_id = "" + listener_ids = ["id1","id2"] + cdb_id = "" + vcdb_name = "" //(MT) + vcdb_database_name = "" //(MT) + target_vcdb_tde_keystore_path = "" //(MT) + parent_tde_keystore_password = "" //(MT) + cdb_tde_keystore_password = "" //(MT) + tde_key_identifier = "" //(MT) + vcdb_tde_key_identifier = "" //(MT) + parent_tde_keystore_path = "" //(MT) + tde_exported_key_file_secret = "" //(MT) + oracle_rac_custom_env_vars = [{ + node_id = "ORACLE_CLUSTER_NODE-1", + name = "MY_ENV_VAR1", + value = "$CRS_HOME/after" + }] //(RAC) + oracle_rac_custom_env_files = [ + { + node_id = "ORACLE_CLUSTER_NODE-1", + path_parameters = "/export/home/env_file_1" + }] //(RAC) + config_params jsonencode({ + processes = 150 + }) + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + tags { + key = "key-1" + value = "value-1" + } + make_current_account_owner = true +} \ No newline at end of file diff --git a/examples/vdb/oracle/snapshot/main.tf b/examples/vdb/oracle/snapshot/main.tf new file mode 100644 index 0000000..e2cdfe5 --- /dev/null +++ b/examples/vdb/oracle/snapshot/main.tf @@ -0,0 +1,160 @@ +/** +* Summary: This template showcases the properties available when provisioning an Oracle database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + snapshot_id = "1-oracle-snapshot-id" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + engine_id = "1" + os_username = "os-user-x" + os_password = "os-password-x" + vdb_restart = true + environment_id = "oracle-env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + auto_select_repository = true + open_reset_logs = true + archive_log = true + online_log_groups = 2 + snapshot_policy_id = "test_snapshot_policy" + unique_name = "dbdhcp2" + online_log_size = 4 + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$ORACLE_HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + file_mapping_rules = "/datafile/dbdhcp3/oradata/dbdhcp3:/data\n/u03/app/ora11202/product/11.2.0/dbhome_1/dbs/dbv_R2V4.dbf:/data/dbv_R2V4.dbf" + new_dbid = true + cluster_node_ids = ["ORACLE_CLUSTER_NODE-ID"] + auxiliary_template_id = "aux-template-1" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + oracle_instance_name = "dbdhcp2" + retention_policy_id = "test_retention_policy" + template_id = "template-1" + cdb_id = "" + listener_ids = ["id"] + repository_id = " " + vcdb_name = "" //(MT) + vcdb_database_name = "" //(MT) + target_vcdb_tde_keystore_path = "" //(MT) + parent_tde_keystore_password = "" //(MT) + cdb_tde_keystore_password = "" //(MT) + tde_key_identifier = "" //(MT) + vcdb_tde_key_identifier = "" //(MT) + parentTdeKeystorePath = "" //(MT) + tde_exported_key_file_secret = "" //(MT) + oracle_rac_custom_env_vars = [{ + node_id = "ORACLE_CLUSTER_NODE-1", + name = "MY_ENV_VAR1", + value = "$CRS_HOME/after" + }] //(RAC) + oracle_rac_custom_env_files = [ + { + node_id = "ORACLE_CLUSTER_NODE-1", + path_parameters = "/export/home/env_file_1" + }] //(RAC) + + config_params jsonencode({ + processes = 150 + }) + pre_start { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + pre_rollback { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + post_start { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + post_rollback { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + pre_stop { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + configure_clone { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + post_snapshot { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + pre_refresh { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + tags { + key = "key-1" + value = "value-1" + } + make_current_account_owner = true +} \ No newline at end of file diff --git a/examples/vdb/oracle/timestamp/main.tf b/examples/vdb/oracle/timestamp/main.tf new file mode 100644 index 0000000..da39843 --- /dev/null +++ b/examples/vdb/oracle/timestamp/main.tf @@ -0,0 +1,159 @@ +/** +* Summary: This template showcases the properties available when provisioning an Oracle database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + timestamp = "" + timestamp_in_database_timezone = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + engine_id = "1" + os_username = "os-user-x" + os_password = "os-password-x" + vdb_restart = true + environment_id = "oracle-env-name" + environment_user_id = "environment_user_name" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + target_group_id = "group-123" + open_reset_logs = true + archive_log = true + online_log_groups = 2 + snapshot_policy_id = "test_snapshot_policy" + unique_name = "dbdhcp2" + online_log_size = 4 + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$ORACLE_HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + file_mapping_rules = "/datafile/dbdhcp3/oradata/dbdhcp3:/data\n/u03/app/ora11202/product/11.2.0/dbhome_1/dbs/dbv_R2V4.dbf:/data/dbv_R2V4.dbf" + new_dbid = true + auxiliary_template_id = "aux-template-1" + oracle_instance_name = "dbdhcp2" + retention_policy_id = "test_retention_policy" + template_id = "template-1" + listener_ids = ["id"] + repository_id = "" + cdb_id = "" + vcdb_name = "" //(MT) + vcdb_database_name = "" //(MT) + target_vcdb_tde_keystore_path = "" //(MT) + parent_tde_keystore_password = "" //(MT) + cdb_tde_keystore_password = "" //(MT) + tde_key_identifier = "" //(MT) + vcdb_tde_key_identifier = "" //(MT) + parentTdeKeystorePath = "" //(MT) + tde_exported_key_file_secret = "" //(MT) + oracle_rac_custom_env_vars = [{ + node_id = "ORACLE_CLUSTER_NODE-1", + name = "MY_ENV_VAR1", + value = "$CRS_HOME/after" + }] //(RAC) + oracle_rac_custom_env_files = [ + { + node_id = "ORACLE_CLUSTER_NODE-1", + path_parameters = "/export/home/env_file_1" + }] //(RAC) + config_params jsonencode({ + processes = 150 + }) + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + tags { + key = "key-1" + value = "value-1" + } + make_current_account_owner = true +} \ No newline at end of file diff --git a/examples/vdb/postgresql/bookmark/main.tf b/examples/vdb/postgresql/bookmark/main.tf new file mode 100644 index 0000000..87ad424 --- /dev/null +++ b/examples/vdb/postgresql/bookmark/main.tf @@ -0,0 +1,138 @@ +/** +* Summary: This template showcases the properties available when provisioning a PostgreSQL database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + bookmark_id = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + repository_id = "" + appdata_source_params = jsonencode({ + mountLocation = "/mnt/GAT" + postgresPort = 5434 + configSettingsStg = [{ propertyName: "timezone", value:"GMT", commentProperty:false}] + }) + config_params jsonencode({ + processes = 150 + }) + appdata_config_params jsonencode({ + param = "value" + }) + additional_mount_points = [{ + shared_path = "/", + mount_path = "/work", + environment_id = "environment-123" + }] + + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file diff --git a/examples/vdb/postgresql/snapshot/main.tf b/examples/vdb/postgresql/snapshot/main.tf new file mode 100644 index 0000000..f2aa01c --- /dev/null +++ b/examples/vdb/postgresql/snapshot/main.tf @@ -0,0 +1,139 @@ +/** +* Summary: This template showcases the properties available when provisioning a PostgreSQL database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + snapshot_id = "snapshot-id" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + engine_id = "1" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + repository_id = "" + appdata_source_params = jsonencode({ + mountLocation = "/mnt/GAT" + postgresPort = 5434 + configSettingsStg = [{ propertyName: "timezone", value:"GMT", commentProperty:false}] + }) + config_params jsonencode({ + processes = 150 + }) + appdata_config_params jsonencode({ + param = "value" + }) + additional_mount_points = [{ + shared_path = "/", + mount_path = "/work", + environment_id = "environment-123" + }] + + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file diff --git a/examples/vdb/postgresql/timestamp/main.tf b/examples/vdb/postgresql/timestamp/main.tf new file mode 100644 index 0000000..9fe33cc --- /dev/null +++ b/examples/vdb/postgresql/timestamp/main.tf @@ -0,0 +1,139 @@ +/** +* Summary: This template showcases the properties available when provisioning a PostgreSQL database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + timestamp = "" + timestamp_in_database_timezone = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + engine_id = "1" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + repository_id = "" + appdata_source_params = jsonencode({ + mountLocation = "/mnt/GAT" + postgresPort = 5434 + configSettingsStg = [{ propertyName: "timezone", value:"GMT", commentProperty:false}] + }) + config_params jsonencode({ + processes = 150 + }) + appdata_config_params jsonencode({ + param = "value" + }) + additional_mount_points = [{ + shared_path = "/", + mount_path = "/work", + environment_id = "environment-123" + }] + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file diff --git a/examples/vdb/sybase/bookmark/main.tf b/examples/vdb/sybase/bookmark/main.tf new file mode 100644 index 0000000..1d3705f --- /dev/null +++ b/examples/vdb/sybase/bookmark/main.tf @@ -0,0 +1,125 @@ +/** +* Summary: This template showcases the properties available when provisioning a SYBASE database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + bookmark_id = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + truncate_log_on_checkpoint = true + repository_id = "" + config_params jsonencode({ + processes = 150 + }) + pre_snapshot { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + pre_stop { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + pre_refresh { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + post_start { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + post_snapshot { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + post_refresh { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + post_stop { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + post_rollback { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + pre_rollback { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + pre_start { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + configure_clone { + name = "string", + command = "string", + shell = "bash", + element_id = "string", + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file diff --git a/examples/vdb/sybase/snapshot/main.tf b/examples/vdb/sybase/snapshot/main.tf new file mode 100644 index 0000000..1913657 --- /dev/null +++ b/examples/vdb/sybase/snapshot/main.tf @@ -0,0 +1,126 @@ +/** +* Summary: This template showcases the properties available when provisioning a SYBASE database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + snapshot_id = "snapshot-id" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + engine_id = "1" + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + repository_id = "" + truncate_log_on_checkpoint = true + config_params jsonencode({ + processes = 150 + }) + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file diff --git a/examples/vdb/sybase/timestamp/main.tf b/examples/vdb/sybase/timestamp/main.tf new file mode 100644 index 0000000..1ccf2c0 --- /dev/null +++ b/examples/vdb/sybase/timestamp/main.tf @@ -0,0 +1,127 @@ +/** +* Summary: This template showcases the properties available when provisioning a SYBASE database from a DCT bookmark. +*/ + +terraform { + required_providers { + delphix = { + version = "VERSION" + source = "delphix-integrations/delphix" + } + } +} + +provider "delphix" { + tls_insecure_skip = true + key = "1.XXXX" + host = "HOSTNAME" +} + +resource "delphix_vdb" "example" { + timestamp = "" + timestamp_in_database_timezone = "" + name = "vdb_to_be_created" + source_data_id = "dsource-name" + engine_id = "1" + vdb_restart = true + environment_id = "env-name" + environment_user_id = "environment_user_name" + target_group_id = "group-123" + snapshot_policy_id = "test_snapshot_policy" + database_name = "dbname_to_be_created" + mount_point = "/var/mnt" + auto_select_repository = true + retention_policy_id = "test_retention_policy" + custom_env_files = ["/export/home/env_file_1"] + custom_env_vars = { + MY_ENV_VAR1 = "$HOME" + MY_ENV_VAR2 = "$CRS_HOME/after" + } + truncate_log_on_checkpoint = true + repository_id = "" + config_params jsonencode({ + processes = 150 + }) + pre_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_snapshot { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_refresh { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_stop { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + post_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_rollback { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + pre_start { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + configure_clone { + name = "string" + command = "string" + shell = "bash" + element_id = "string" + has_credentials = true + } + make_current_account_owner = true + tags { + key = "key-1" + value = "value-1" + } +} \ No newline at end of file