Skip to content

Commit

Permalink
Merge pull request #82 from delphix-integrations/develop
Browse files Browse the repository at this point in the history
HUBS-2073 | Release Version 3.2.0 | Develop -> Main
  • Loading branch information
ankit-patil-hubs authored Mar 21, 2024
2 parents 0f6c290 + f426207 commit accc00f
Show file tree
Hide file tree
Showing 26 changed files with 1,217 additions and 783 deletions.
74 changes: 52 additions & 22 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
# CodeQL configuration for the dxi-terraform-provider repo
#
# Copyright (c) 2023, 2024 by Delphix. All rights reserved.
#
#
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ develop ]
# The branches below must be a subset of the branches above
branches: [ "develop" ]
schedule:
- cron: '40 13 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
Expand All @@ -20,38 +43,45 @@ jobs:
fail-fast: false
matrix:
language: [ 'go' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: actions/setup-go@v2
with:
go-version: '^1.17.7'
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
queries: security-extended,security-and-quality
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- if: matrix.language == 'go'
name: Autobuild
uses: github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

#- run: |
# make bootstrap
# make release
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Visit https://goreleaser.com for documentation on how to customize this
# behavior.
env:
- PROVIDER_VERSION=3.1.0
- PROVIDER_VERSION=3.2.0
before:
hooks:
# this is just an example and not a requirement for provider building/publishing
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOSTNAME=delphix.com
NAMESPACE=dct
NAME=delphix
BINARY=terraform-provider-${NAME}
VERSION=3.1.0
VERSION=3.2.0
OS_ARCH=darwin_amd64

default: install
Expand Down
62 changes: 45 additions & 17 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,53 @@
# <provider> Delphix Provider

!> **NOTE**
The Terraform Provider for Delphix requires the Delphix Continuous Data Platform and Data Control Tower (DCT).
The Terraform Provider for Delphix enables you to natively manage data-as-code along with your infrastructure.

With Terraform and Delphix, you can now automatically provision, manage, and teardown any number of ephemeral data environments to drive enterprise DevOps workflows, such as test data management.

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 communicates directly with Data Control Tower (DCT) to generated virtual database and other objects. Therefore, DCT must be registered with one or more Delphix Continuous Data Engines.

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 Documentation](https://documentation.delphix.com/docs/) and [DCT Documentation](https://dct.delphix.com/docs/latest/) respectively. Please [Contact us](ask-integrations@delphix.com) (ask-integrations@delphix.com) with any questions.

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. Please [Contact us](ask-integrations@delphix.com) (ask-integrations@delphix.com) with any questions.
If you are entitled to Data Control Tower then you may also send support issues through the [Delphix Support Portal](https://support.delphix.com/).

## System Requirements

| Product | Version |
|--------------------------------|----------|
| Data Control Tower (DCT) | v14+ |
| Delphix Continuous Data Engine | v6.0.0.1+ |

Note: The DCT version above guarantees full provider support. However, each resource might support older versions. Refer to the specific resource documentation page for more information.

## Release Notes

The Delphix Provider's complete release notes can be found in the [Delphix Ecosystem Documentation](https://ecosystem.delphix.com/docs/main/release-notes-terraform).

## Connectivity and Authentication

All communication is performed through HTTPS. The Delphix Provider uses Data Control Tower (DCT) APIs to communicate with Delphix Continuous Data Engines.

Authentication with DCT APIs are managed using API Keys. For generation of an API key, please refer to [DCT API Keys](https://dct.delphix.com/docs/latest/api-keys).

## Example Usage

The following script demonstrates how to configure the Delphix Provider to connect with Data Control Tower and then provision a VDB. Additional resource guides and documentation can be found on the left hand side.

```hcl
terraform {
required_providers {
delphix = {
source = "delphix-integrations/delphix"
version = "1.0.0"
version = "3.2.0"
}
}
}
# Configure the DXI Provider
provider "delphix" {
tls_insecure_skip = true
key = "dct_api_key"
host = "dct_hostname"
key = "dct_api_key"
tls_insecure_skip = false
}
# Provision a VDB
Expand All @@ -37,15 +57,23 @@ resource "delphix_vdb" "vdb_name" {
}
```

## Configuration and API Key Generation
### Example Global Parameter Reference

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).
* __host__: The hostname for DCT.
* __key__ : The API Key which is used to authenticate with DCT. (Example `apk 2.abc123...`).
* __tls_insecure_skip__: (Optional) A boolean value which determines whether to skip the SSL/TLS check. The default value is `false`. Skipping any SSL/TLS check is not recommended for production environments.
* __host_scheme__: (Optional) Determines the configured host URL's scheme. The default value is `https`.

Consult the documentation's Resources section for details on individual resources, such as VDB, dSource, and Environment.

## Support Matrix

## Argument Reference
Feature/Product | Provider Version | DCT version
--- |------------------| --- |
delphix_vdb | v 1.0.0 | v 2.0.0
delphix_vdb_group | v 1.0.0 | v 2.0.0
delphix_environment | v 1.0.0 | v 2.0.0
delphix_appdata_dsource | v 2.1.0 | v 10.0.0
delphix_oracle_dsource | v 3.1.0 | v 10.0.0
delphix_database_postgresql | v 3.2.0 | v 14.0.0

* __key__ : The API key is provided in this field that gets passed on to DCT for authentication.
* __host__: The host name for where DCT APIGW is running.
* __tls_insecure_skip__: This takes a boolean value which determines whether to skip the TLS check. tls_insecure_skip is really unsafe to set it to true. By default it is `false`.
* __host_scheme__: Determines the host scheme configured. By default it is `https`.
6 changes: 5 additions & 1 deletion docs/resources/appdata_dsource.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,8 @@ resource "delphix_appdata_dsource" "dsource_name" {

* `parameters` - (Optional) The JSON payload is based on the type of dSource being created. Different data sources require different parameters.

* `sync_parameters` - (Optional) The JSON payload conforming to the snapshot parameters definition in a LUA toolkit or platform plugin.
* `sync_parameters` - (Optional) The JSON payload conforming to the snapshot parameters definition in a LUA toolkit or platform plugin.

* `skip_wait_for_snapshot_creation` - (Optional) By default this resource will wait for a snapshot to be created post-dSource creation. This ensure a snapshot is available during the VDB provisioning. This behavior can be skipped by setting this parameter to `true`.

* `wait_time` - (Optional) By default this resource waits 3 minutes for a snapshot to be created. Increase the integer value as needed for larger dSource snapshots. This parameter can be ignored if 'skip_wait_for_snapshot_creation' is set to `true`.
68 changes: 68 additions & 0 deletions docs/resources/database_postgresql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Resource: <resource name> delphix_database_postgresql

In the Delphix Platform, a Database (or Source Config) identifies the environment's location from which a specific source dataset can be ingested from. dSources are then created from these Databases.

## System Requirements

* Data Control Tower v14.0.1+ is required for database management. Lower versions are not supported.
* The Database PostgreSQL resource only supports the Delphix PostgreSQL database type (POSTGRES). This resource does not support Oracle, SQL Server, or SAP ASE.

## Example Usage

```hcl
# Create a postgres database/source.
resource "delphix_database_postgresql" "source" {
name = "test"
repository_value = "REPO-1"
engine_value = "2"
environment_value = "ENV-1"
}
```

## Argument Reference

* `name` - (Required) The name of the new source.

* `repository_value` - (Required) The Id or Name of the Repository onto which the source will be created..

* `environment_value` - (Optional) The Id or Name of the environment to create the source on.

* `engine_value` - (Optional) The Id or Name of the engine to create the source on.

* `id` - The Source object entity ID.

* `database_type` - The type of this source database.

* `namespace_id` - The namespace id of this source database.

* `namespace_name` - The namespace name of this source database.

* `is_replica` - Is this a replicated object.

* `database_version` - The version of this source database.

* `data_uuid` - A universal ID that uniquely identifies this source database.

* `ip_address` - The IP address of the source's host.

* `fqdn` - The FQDN of the source's host.

* `size` - The total size of this source database, in bytes.

* `jdbc_connection_string` - The JDBC connection URL for this source database.

* `plugin_version` - The version of the plugin associated with this source database.

* `toolkit_id` - The ID of the toolkit associated with this source database(AppData only).

* `is_dsource` - Is this associated with dSource.

* `repository` - The repository id for this source.

* `appdata_source_type` - The type of this appdata source database (Appdata Only).

* `tags` - The tags to be created for database. This is a map of 2 parameters:
* `key` - Key of the tag
* `value` - Value of the tag
1 change: 1 addition & 0 deletions docs/resources/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,4 @@ resource "delphix_environment" "fc-tgt-cluster" {
* `engine_id` - A reference to the Engine that this Environment connection is associated with.
* `enabled` - True if this environment is enabled.
* `hosts` - The hosts that are part of this environment.
* `repositories` - The repositories that are part of this environment.
3 changes: 3 additions & 0 deletions docs/resources/oracle_dsource.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,6 @@ resource "delphix_oracle_dsource" "test_oracle_dsource" {
* `azure_vault_secret_key` - Azure vault key in the key-value store.
* `cyberark_vault_query_string` - Query to find a credential in the CyberArk vault.

* `skip_wait_for_snapshot_creation` - (Optional) By default this resource will wait for a snapshot to be created post-dSource creation. This ensure a snapshot is available during the VDB provisioning. This behavior can be skipped by setting this parameter to `true`.

* `wait_time` - (Optional) By default this resource waits 3 minutes for a snapshot to be created. Increase the integer value as needed for larger dSource snapshots. This parameter can be ignored if 'skip_wait_for_snapshot_creation' is set to `true`.
51 changes: 51 additions & 0 deletions examples/appdata_dsource/mysql/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Summary: This template showcases the properties available when creating an app data dsource.
*/

terraform {
required_providers {
delphix = {
version = "VERSION"
source = "delphix-integrations/delphix"
}
}
}

provider "delphix" {
tls_insecure_skip = true
key = "1.XXXX"
host = "HOSTNAME"
}

#dsource with replication

resource "delphix_appdata_dsource" "test_app_data_dsource" {
source_value = "1-APPDATA_STAGED_SOURCE_CONFIG-6"
group_id = "1-GROUP-1"
log_sync_enabled = false
make_current_account_owner = true
link_type = "AppDataStaged"
name = "appdata_dsource"
staging_mount_base = ""
environment_user = "HOST_USER-2"
staging_environment = "1-UNIX_HOST_ENVIRONMENT-2"
parameters = jsonencode({
dSourceType : "Replication",
mountPath : "/delphix/zfs3",
stagingPort : 3310,
serverId : 106 ,
sourceip : "10.110.203.176",
sourceUse : "XXXX",
sourcePass : "XXXX",
logSync: true,
replicationUser: "XXXX",
replicationPass: "XXXX",
databaseList: "ALL",
backupPath: "",
stagingBasedir: "/usr",
stagingPass: "XXXX"
})
sync_parameters = jsonencode({
resync = true
})
}
File renamed without changes.
25 changes: 25 additions & 0 deletions examples/database/postgresql/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Summary: This template showcases the properties available when creating an source.
*/

terraform {
required_providers {
delphix = {
version = "VERSION"
source = "delphix-integrations/delphix"
}
}
}

provider "delphix" {
key = "1.XXXX"
host = "HOSTNAME"
}

resource "delphix_database_postgresql" "source" {
name = "test"
repository_value = "REPO-1"
engine_value = "2"
environment_value = "ENV-1"
}

Loading

0 comments on commit accc00f

Please sign in to comment.