From af1a0d80119664243ae3f8f95bd35a6d91a42a43 Mon Sep 17 00:00:00 2001 From: Sunny Suthar Date: Wed, 6 Apr 2022 09:56:51 -0700 Subject: [PATCH 01/10] Add goreleaser Github Action --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b0b46c8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +# This GitHub action can publish assets for release when a tag is created. +# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0). +# +# This uses an action (hashicorp/ghaction-import-gpg) that assumes you set your +# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE` +# secret. If you would rather own your own GPG handling, please fork this action +# or use an alternative one for key handling. +# +# You will need to pass the `--batch` flag to `gpg` in your signing step +# in `goreleaser` to indicate this is being used in a non-interactive mode. +# +name: release +on: + push: + tags: + - 'v*' +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Unshallow + run: git fetch --prune --unshallow + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - + name: Import GPG key + id: import_gpg + uses: hashicorp/ghaction-import-gpg@v2.1.0 + env: + # These secrets will need to be configured for the repository: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + PASSPHRASE: ${{ secrets.PASSPHRASE }} + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2.9.1 + with: + version: latest + args: release --rm-dist + env: + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + # GitHub sets this automatically + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 5a3756b91e1e938dca157c621dfbd0135faf6697 Mon Sep 17 00:00:00 2001 From: Sunny Suthar Date: Wed, 6 Apr 2022 10:34:04 -0700 Subject: [PATCH 02/10] Change version to 0.1-beta for test release --- .goreleaser.yml | 2 +- GNUmakefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index c9e9dfd..95057ea 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,7 @@ # Visit https://goreleaser.com for documentation on how to customize this # behavior. env: - - PROVIDER_VERSION=1.0-beta + - PROVIDER_VERSION=0.1-beta before: hooks: # this is just an example and not a requirement for provider building/publishing diff --git a/GNUmakefile b/GNUmakefile index 8b793f3..bb6f014 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -3,7 +3,7 @@ HOSTNAME=delphix.com NAMESPACE=dct NAME=delphix BINARY=terraform-provider-${NAME} -VERSION=1.0-beta +VERSION=0.1-beta OS_ARCH=darwin_amd64 default: install From b5569c3e5afcad13c3d43ef562e024b2743f28f6 Mon Sep 17 00:00:00 2001 From: sunnyx4 <81378792+sunnyx4@users.noreply.github.com> Date: Wed, 6 Apr 2022 10:41:12 -0700 Subject: [PATCH 03/10] Change version to 0.1-beta for test release (#9) (#10) * Add goreleaser Github Action * Change version to 0.1-beta for test release --- .goreleaser.yml | 2 +- GNUmakefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index c9e9dfd..95057ea 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,7 @@ # Visit https://goreleaser.com for documentation on how to customize this # behavior. env: - - PROVIDER_VERSION=1.0-beta + - PROVIDER_VERSION=0.1-beta before: hooks: # this is just an example and not a requirement for provider building/publishing diff --git a/GNUmakefile b/GNUmakefile index 8b793f3..bb6f014 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -3,7 +3,7 @@ HOSTNAME=delphix.com NAMESPACE=dct NAME=delphix BINARY=terraform-provider-${NAME} -VERSION=1.0-beta +VERSION=0.1-beta OS_ARCH=darwin_amd64 default: install From b523edc00f1b88de073d4944924f39f5406f05c7 Mon Sep 17 00:00:00 2001 From: Sunny Suthar Date: Wed, 6 Apr 2022 10:46:56 -0700 Subject: [PATCH 04/10] Change the Go version in 1.17 in release action --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0b46c8..785393f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: name: Set up Go uses: actions/setup-go@v2 with: - go-version: 1.16 + go-version: 1.17 - name: Import GPG key id: import_gpg From 85debd3fdec999b5df4171653dc1beb6501fdf73 Mon Sep 17 00:00:00 2001 From: Sunny Suthar Date: Wed, 6 Apr 2022 11:06:24 -0700 Subject: [PATCH 05/10] Add signs block in goreleaser.yml --- .goreleaser.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index 95057ea..8a058e8 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -49,6 +49,18 @@ checksum: name_template: '{{ .ProjectName }}_{{ .Env.PROVIDER_VERSION }}_manifest.json' name_template: '{{ .ProjectName }}_{{ .Env.PROVIDER_VERSION }}_SHA256SUMS' algorithm: sha256 +signs: + - artifacts: checksum + args: + # if you are using this in a GitHub action or some other automated pipeline, you + # need to pass the batch flag to indicate its not interactive. + - "--batch" + - "--local-user" + - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key + - "--output" + - "${signature}" + - "--detach-sign" + - "${artifact}" release: extra_files: - glob: 'terraform-registry-manifest.json' From 82b2e70e57d1d0931fac9a889db833a100a50546 Mon Sep 17 00:00:00 2001 From: arunskurian <70768312+arunskurian@users.noreply.github.com> Date: Wed, 6 Apr 2022 17:23:09 -0400 Subject: [PATCH 06/10] Adding badges (#15) (#16) * Relative path to CodeQL badge * Adding badges * Adding badges --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index b84c68d..716bd3f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Terraform Provider Delphix +![CodeQL](https://github.com/delphix-integrations/terraform-provider-delphix/actions/workflows/codeql.yml/badge.svg?branch=main) +![Release](https://github.com/delphix-integrations/terraform-provider-delphix/actions/workflows/release.yml/badge.svg?event=release) +![Version](https://img.shields.io/github/v/release/delphix-integrations/terraform-provider-delphix) + Terraform Provider for Delphix enables Terraform to create and manage Delphix Continuous Data & Continuous Compliance infrastructure using the Delphix Control Tower (DCT) APIs. From b2d0c5479a1f6cb44461c8998845a77ce911e484 Mon Sep 17 00:00:00 2001 From: arunskurian <70768312+arunskurian@users.noreply.github.com> Date: Wed, 6 Apr 2022 18:11:53 -0400 Subject: [PATCH 07/10] Correcting release badge (#17) * Relative path to CodeQL badge * Adding badges * Adding badges * Updating release status * Updated ReadMe for DCT --- README.md | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 716bd3f..177c43e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Terraform Provider Delphix ![CodeQL](https://github.com/delphix-integrations/terraform-provider-delphix/actions/workflows/codeql.yml/badge.svg?branch=main) -![Release](https://github.com/delphix-integrations/terraform-provider-delphix/actions/workflows/release.yml/badge.svg?event=release) ![Version](https://img.shields.io/github/v/release/delphix-integrations/terraform-provider-delphix) Terraform Provider for Delphix enables Terraform to create and manage Delphix Continuous Data & @@ -9,29 +8,36 @@ Continuous Compliance infrastructure using the Delphix Control Tower (DCT) APIs. Full documentation can he found [here](https://integrations.delphix.com/Terraform/) -## Getting Started (Development) -This guide will eventually cover the following +## Prerequisites + +1. Setup Delphix Control Tower(DCT) API Layer. For more information, visit [DCT Home.](https://docs.delphix.com/dct) +2. Delphix Engines must be registered with DCT APIs +3. API-Keys must be created for authenticating with DCT APIs. Refer to [DCT Home](https://docs.delphix.com/dct) for more info. +4. Additional infrastructure required for testing the provider operations [ e.g Hosts to be added as environments, dSources to create VDBs from] +5. Development setup for GoLang. + +## Getting Started (Development) -1. Setup DCT APi Gateway On Premise by following the [DCT API Gateway setup](https://github.com/delphix/orbital-api-gateway) +This guide covers the following -2. Install IDE [Visual Studio Code](https://code.visualstudio.com) +1. Install IDE [Visual Studio Code](https://code.visualstudio.com) -3. Install guide for [golang](https://go.dev/dl/) +2. Install guide for [golang](https://go.dev/dl/) -4. Install guide for [Goreleaser](https://goreleaser.com/install/) +3. Install guide for [Goreleaser](https://goreleaser.com/install/) -5. Install Go Plugin for VS Code +4. Install Go Plugin for VS Code -6. Install [Terraform](https://www.terraform.io/downloads) +5. Install [Terraform](https://www.terraform.io/downloads) -7. Fork this repo and clone it locally. Switch to develop branch which always heads to the latest development code. +6. Fork this repo and clone it locally. Switch to develop branch which always heads to the latest development code. -8. Run following command to create binaries: +7. Run following command to create binaries: ```goreleaser release --skip-publish --snapshot --rm-dist``` -9. Execute example main.tf file under /examples/ directory using the following commands: +8. Execute example main.tf file under /examples/ directory using the following commands: ``` terraform init @@ -39,13 +45,5 @@ This guide will eventually cover the following terraform apply ``` -## Prerequisites - -- Delphix Control Tower (DCT) API Gateway must be installed on-premise. -- Delphix Engines must be registered with DCT-OnPrem. -- API-Keys must be created for authenticating with DCT-OnPrem. Refer to DCT guide for more info. -- Additional infrastructure required for testing the provider operations [ e.g Hosts to be added as environments, dSources to create VDBs from] -- Development setup for GoLang. - ## Contributing This project is currently not accepting external contributions. From 4978b7d112d8eb506e61cbbee6c93fb647c79360 Mon Sep 17 00:00:00 2001 From: sunnyx4 <81378792+sunnyx4@users.noreply.github.com> Date: Wed, 6 Apr 2022 16:12:53 -0700 Subject: [PATCH 08/10] Change version to 0.0.1-beta (#18) --- .goreleaser.yml | 14 +++++++------- GNUmakefile | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 8a058e8..0eae2e5 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,7 @@ # Visit https://goreleaser.com for documentation on how to customize this # behavior. env: - - PROVIDER_VERSION=0.1-beta + - PROVIDER_VERSION=0.0.1-beta before: hooks: # this is just an example and not a requirement for provider building/publishing @@ -33,12 +33,12 @@ builds: - goos: darwin goarch: '386' binary: terraform-provider-delphix - hooks: - post: + hooks: + post: - cmd: ./dev_copy.sh - env: + env: - CP_PATH={{ .Path }} - - CP_TARGET={{ .Target }} + - CP_TARGET={{ .Target }} - CP_VERSION={{ .Env.PROVIDER_VERSION }} archives: - format: zip @@ -52,7 +52,7 @@ checksum: signs: - artifacts: checksum args: - # if you are using this in a GitHub action or some other automated pipeline, you + # if you are using this in a GitHub action or some other automated pipeline, you # need to pass the batch flag to indicate its not interactive. - "--batch" - "--local-user" @@ -68,4 +68,4 @@ release: # If you want to manually examine the release before its live, uncomment this line: # draft: true changelog: - skip: true \ No newline at end of file + skip: true diff --git a/GNUmakefile b/GNUmakefile index bb6f014..6693c16 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -3,7 +3,7 @@ HOSTNAME=delphix.com NAMESPACE=dct NAME=delphix BINARY=terraform-provider-${NAME} -VERSION=0.1-beta +VERSION=0.0.1-beta OS_ARCH=darwin_amd64 default: install @@ -29,9 +29,9 @@ install: build mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH} -test: - go test -i $(TEST) || exit 1 - echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 +test: + go test -i $(TEST) || exit 1 + echo $(TEST) | xargs -t -n4 go test $(TESTARGS) -timeout=30s -parallel=4 -testacc: - TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m +testacc: + TF_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 120m From b1c75980a3f0bcba8d966a9f20f74a02ed4020fd Mon Sep 17 00:00:00 2001 From: arunskurian <70768312+arunskurian@users.noreply.github.com> Date: Thu, 7 Apr 2022 17:04:41 -0400 Subject: [PATCH 09/10] Documentation updates for Terraform registry (#19) * Updating VDB Documentation * Updating version of provider --- .goreleaser.yml | 2 +- GNUmakefile | 2 +- docs/index.md | 24 ++++++++++++++--------- docs/resources/environment.md | 37 ++++++++++++++++++++--------------- docs/resources/vdb.md | 7 ++++++- 5 files changed, 44 insertions(+), 28 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 0eae2e5..10089b7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,7 @@ # Visit https://goreleaser.com for documentation on how to customize this # behavior. env: - - PROVIDER_VERSION=0.0.1-beta + - PROVIDER_VERSION=1.0.0-beta before: hooks: # this is just an example and not a requirement for provider building/publishing diff --git a/GNUmakefile b/GNUmakefile index 6693c16..8c84e4b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -3,7 +3,7 @@ HOSTNAME=delphix.com NAMESPACE=dct NAME=delphix BINARY=terraform-provider-${NAME} -VERSION=0.0.1-beta +VERSION=1.0.0-beta OS_ARCH=darwin_amd64 default: install diff --git a/docs/index.md b/docs/index.md index 9d89f5a..5038df5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,10 +1,15 @@ -# Terraform-Provider-Delphix +# Delphix Provider !> **NOTE** -It is a beta version as of now and it requires Delphix Control Tower 2.0. to work. +The Terraform Provider for Delphix is currently beta and requires Delphix Control Tower (DCT) APIs to work. -Delphix Terraform provider to interact with different infrastructure resources supported by Delphix. You must configure the provider -with the proper API key generated by DCT and register your Delphix Engine before you can use it. + +The Terraform Provider for Delphix enables customers to natively manage data-as-code along with their infrastructure. +With Terraform and Delphix, customers can now automatically provision, manage and teardown any number of ephemeral data environments to drive enterprise DevOps workflows including test data management. + +This provider leverages the Delphix APIs available with the Delphix Data Control Tower (DCT). The provider must be configured with the proper API key generated by DCT and registered with associated Delphix engines before use + +To learn more about Delphix and DCT APIs, refer to [Delphix Docs](https://docs.delphix.com) and [DCT Docs](https://docs.delphix.com/dct) respectively. ## Example Usage @@ -12,8 +17,8 @@ with the proper API key generated by DCT and register your Delphix Engine before terraform { required_providers { delphix = { - version = "1.0.0" - source = "delphix.com/local/delphix" + source = "delphix-integrations/delphix" + version = "1.0.0-beta" } } } @@ -21,8 +26,8 @@ terraform { # Configure the DXI Provider provider "delphix" { tls_insecure_skip = true - key = "1.XXXX" - host = "HOSTNAME" + key = "dct_api_key" + host = "dct_hostname" } # Provision a VDB @@ -34,7 +39,8 @@ resource "delphix_vdb" "vdb_name" { ## Configuration and API Key Generation -For generation of the API key, please refer to [Authentication](https://docs.delphix.com/dctmc/authentication). +Delphix Provider uses DCT APIs to communicate with the Delphix engines. Authentication to DCT APIs are handled using API Keys. +For generation of the API key, please refer to [Authentication](https://docs.delphix.com/dct/authentication-170164311.html). ## Argument Reference diff --git a/docs/resources/environment.md b/docs/resources/environment.md index 85abebc..c94f668 100644 --- a/docs/resources/environment.md +++ b/docs/resources/environment.md @@ -1,10 +1,15 @@ # Resource: delphix_environment -An environment is a a grouping of a single host or a cluster of hosts. environment allows creating hosts or a cluster of hosts. +In Delphix, an environment is either a single instance host or cluster of hosts that run database software. + +Environments can either be a source (where data comes from), staging (where data are prepared/masked) or target (where data are delivered and used by developers and testers). + +Each environment has its own properties and information depending on the type of environment it is ## Example Usage -### Creating a UNIX standalone environment +### Create UNIX standalone environment + ```hcl resource "delphix_environment" "unix_env_name" { engine_id = 2 @@ -31,7 +36,7 @@ resource "delphix_environment" "unix_env_name" { is_target = false } ``` -### Creating a UNIX cluster +### Create UNIX cluster ```hcl resource "delphix_environment" "unixcluster" { engine_id = 2 @@ -124,28 +129,28 @@ resource "delphix_environment" "fc-tgt-cluster" { ## Argument Reference -* `name` - (Optional) The name of the environment. -* `engine_id` - (Required) The ID of the Engine onto which to create the environment. +* `engine_id` - (Required) The DCT ID of the Engine on which to create the environment. This ID can be obtained by querying the DCT engines API. A Delphix Engine must be registered with DCT first for it to create an Engine ID. * `os_name` - (Required) Operating system type of the environment. Valid values are `[UNIX, WINDOWS]` +* `hostname` - (Required) Host Name or IP Address of the host that being added to Delphix. +* `name` - (Optional) The name of the environment. * `is_cluster` - (Optional) Whether the environment to be created is a cluster. -* `cluster_home` - (Optional) Absolute path to cluster home drectory. This parameter is mandatory for UNIX cluster environments. -* `hostname` - (Required) host address of the machine. -* `staging_environment` - (Optional) Id of the connector environment which is used to connect to this source environment. This is mandatory parameter when creating Windows source environments. -* `connector_port` - (Optional) Specify port on which Delphix connector will run. This is mandatory parameter when creating Windows target environments. +* `cluster_home` - (Optional) Absolute path to cluster home drectory. This parameter is (Required) for UNIX cluster environments. +* `staging_environment` - (Optional) Id of the environment where Delphix Connector is installed. This is a (Required) parameter when creating Windows source environments. +* `connector_port` - (Optional) Specify port on which Delphix connector will run. This is a (Required) parameter when creating Windows target environments. * `is_target` - (Optional) Whether the environment to be created is a target cluster environment. This property is used only when creating Windows cluster environments. -* `ssh_port` - (Optional) ssh port of the host. -* `toolkit_path` - (Optional) The path for the toolkit that resides on the host. -* `username` - (Optional) Username of the OS. -* `password` - (Optional) Password of the OS. +* `ssh_port` - (Optional) ssh port of the environment. +* `toolkit_path` - (Optional) The path where Delphix toolkit can be pushed. +* `username` - (Optional) OS username for Delphix. +* `password` - (Optional) OS user's password. * `vault` - (Optional) The name or reference of the vault from which to read the host credentials. * `hashicorp_vault_engine` - (Optional) Vault engine name where the credential is stored. * `hashicorp_vault_secret_path` - (Optional) Path in the vault engine where the credential is stored. * `hashicorp_vault_username_key` - (Optional) Key for the username in the key-value store. * `hashicorp_vault_secret_key` - (Optional) Key for the password in the key-value store. * `cyberark_vault_query_string` - (Optional) Query to find a credential in the CyberArk vault. -* `nfs_addresses` - (Optional) array of ip address or hostnames. Valid values are a list of addresses. For eg: `["192.168.10.2"]` -* `ase_db_username` - (Optional) username of the SAP ASE database. -* `ase_db_password` - (Optional) password of the SAP ASE database. +* `nfs_addresses` - (Optional) Array of ip address or hostnames. Valid values are a list of addresses. For eg: `["192.168.10.2"]` +* `ase_db_username` - (Optional) Username for the SAP ASE database. +* `ase_db_password` - (Optional) Password for the SAP ASE database. * `ase_db_vault` - (Optional) The name or reference of the vault from which to read the ASE database credentials. * `ase_db_hashicorp_vault_engine` - (Optional) Vault engine name where the credential is stored. * `ase_db_hashicorp_vault_secret_path` - (Optional) Path in the vault engine where the credential is stored. diff --git a/docs/resources/vdb.md b/docs/resources/vdb.md index 2c812b7..c1a2855 100644 --- a/docs/resources/vdb.md +++ b/docs/resources/vdb.md @@ -1,6 +1,11 @@ # Resource: delphix_vdb -The VDB resource allows the provisioning, updation and deletion of a Delphix virtual database infrastructure (VDB). However, update is not supported for all parameters, the ones supported is mentioned below. +In Delphix terminology, a VDB is a database provisioned from either a dSource or another VDB which is a full read/write copy of the source data. +A VDB is created and managed by the Delphix Continuous Data Engine. + + +The VDB resource allows terraform to CREATE (also known as Provision), READ, UPDATE and DELETE Delphix Virtual Databases (VDB). +Update operation does not support all VDB parameters. The supported parameters are listed below. ## Example Usage Provisioning can be done in 2 methods, provision by snapshot and provision by timestamp. From 88992779806577d59d5067ee3423439f16b01675 Mon Sep 17 00:00:00 2001 From: Jules Tamagnan Date: Mon, 2 May 2022 10:29:53 -0700 Subject: [PATCH 10/10] TOOL-13695 Merge develop into main --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 177c43e..b351365 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Terraform Provider Delphix ![CodeQL](https://github.com/delphix-integrations/terraform-provider-delphix/actions/workflows/codeql.yml/badge.svg?branch=main) +![Release](https://github.com/delphix-integrations/terraform-provider-delphix/actions/workflows/release.yml/badge.svg?event=release) ![Version](https://img.shields.io/github/v/release/delphix-integrations/terraform-provider-delphix) Terraform Provider for Delphix enables Terraform to create and manage Delphix Continuous Data &