Skip to content

Commit 8b4c3b9

Browse files
create the md for dsource documentation , updated the version for provider
1 parent 56d2bf7 commit 8b4c3b9

File tree

3 files changed

+217
-14
lines changed

3 files changed

+217
-14
lines changed

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Visit https://goreleaser.com for documentation on how to customize this
22
# behavior.
33
env:
4-
- PROVIDER_VERSION=2.0.0
4+
- PROVIDER_VERSION=3.0.0
55
before:
66
hooks:
77
# this is just an example and not a requirement for provider building/publishing

docs/resources/appdata_dsource.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
# Resource: <resource name> delphix_appdata_dsource
2+
3+
In Delphix terminology, a dSource is a database that the Delphix Virtualization Engine uses to create and update virtual copies of your database.
4+
A dSource is created and managed by the Delphix Continuous Data Engine.
5+
6+
7+
The dSource resource allows terraform to CREATE, READ and DELETE dSources.
8+
Update operation is not supported. The supported parameters are listed below.
9+
10+
## Example Usage
11+
dSource Linking can be done in 3 methods , the parametes for these methods wary based on choice.
12+
13+
```hcl
14+
# Link dSource using external backup.
15+
16+
resource "delphix_appdata_dsource" "dsource_name" {
17+
source_id = SOURCE_ID
18+
group_id = GROUP_ID
19+
log_sync_enabled = false
20+
make_current_account_owner = true
21+
link_type = LINK_TYPE
22+
name = DSOURCE_NAME
23+
staging_mount_base = MOUNT_PATH
24+
environment_user = ENV_USER
25+
staging_environment = STAGING_ENV
26+
parameters = jsonencode({
27+
externalBackup: [
28+
{
29+
keepStagingInSync: false,
30+
backupPath: BKP_PATH,
31+
walLogPath: LOG_PATH
32+
}
33+
],
34+
postgresPort : PORT,
35+
mountLocation : MOUNT_PATH
36+
})
37+
sync_parameters = jsonencode({
38+
resync = true
39+
})
40+
}
41+
42+
# Link dSource using delphix Initiated Backup.
43+
44+
resource "delphix_appdata_dsource" "dsource_name" {
45+
source_id = SOURCE_ID
46+
group_id = GROUP_ID
47+
log_sync_enabled = false
48+
make_current_account_owner = true
49+
link_type = LINK_TYPE
50+
name = DSOURCE_NAME
51+
staging_mount_base = MOUNT_PATH
52+
environment_user = ENV_USER
53+
staging_environment = STAGING_ENV
54+
parameters = jsonencode({
55+
delphixInitiatedBackupFlag : true,
56+
delphixInitiatedBackup : [
57+
{
58+
userName : USERNAME,
59+
postgresSourcePort : SOURCE_PORT,
60+
userPass : PASSWORD,
61+
sourceHostAddress : SOURCE_ADDRESS
62+
}
63+
],
64+
postgresPort : PORT,
65+
mountLocation : MOUNT_PATH
66+
})
67+
sync_parameters = jsonencode({
68+
resync = true
69+
})
70+
}
71+
72+
# Link dSource using single Database Ingestion.
73+
74+
resource "delphix_appdata_dsource" "dsource_name" {
75+
source_id = SOURCE_ID
76+
group_id = GROUP_ID
77+
log_sync_enabled = false
78+
make_current_account_owner = true
79+
link_type = LINK_TYPE
80+
name = DSOURCE_NAME
81+
staging_mount_base = MOUNT_PATH
82+
environment_user = ENV_USER
83+
staging_environment = STAGING_ENV
84+
parameters = jsonencode({
85+
singleDatabaseIngestionFlag : true,
86+
singleDatabaseIngestion : [
87+
{
88+
databaseUserName: DBUSER_NAME,
89+
sourcePort: SOURCE_PORT,
90+
dumpJobs: 2,
91+
restoreJobs: 2,
92+
databaseName: DB_NAME,
93+
databaseUserPassword: DB_PASS,
94+
dumpDir: DIR,
95+
sourceHost: SOURCE_HOST
96+
postgresqlFile: FILE
97+
}
98+
],
99+
postgresPort : PORT,
100+
mountLocation : MOUNT_PATH
101+
})
102+
sync_parameters = jsonencode({
103+
resync = true
104+
})
105+
}
106+
```
107+
108+
## Argument Reference
109+
110+
* `source_id` - (Required) Id of the source to link.
111+
112+
* `group_id` - (Optional) Id of the dataset group where this dSource should belong to.
113+
114+
* `log_sync_enabled` - (Required) True if LogSync should run for this database.
115+
116+
* `make_current_account_owner` - (Required) Whether the account creating this reporting schedule must be configured as owner of the reporting schedule.
117+
118+
* `description` - (Optional) The notes/description for the dSource.
119+
120+
* `link_type` - (Required) The type of link to create. Default is AppDataDirect.
121+
* `AppDataDirect` - Represents the AppData specific parameters of a link request for a source directly replicated into the Delphix Engine.
122+
* `AppDataStaged` - Represents the AppData specific parameters of a link request for a source with a staging source.
123+
124+
* `name` - (Optional) The unique name of the dSource. If unset, a name is randomly generated.
125+
126+
* `staging_mount_base` - (Optional) The base mount point for the NFS mount on the staging environment [AppDataStaged only].
127+
128+
* `environment_user` - (Required) The OS user to use for linking.
129+
130+
* `staging_environment` - (Required) The environment used as an intermediate stage to pull data into Delphix [AppDataStaged only].
131+
132+
* `staging_environment_user` - (Optional) The environment user used to access the staging environment [AppDataStaged only].
133+
134+
* `tags` - (Optional) The tags to be created for dSource. This is a map of 2 parameters:
135+
* `key` - (Required) Key of the tag
136+
* `value` - (Required) Value of the tag
137+
138+
* `ops_pre_sync` - (Optional) Operations to perform before syncing the created dSource. These operations can quiesce any data prior to syncing
139+
* `name` - Name of the hook
140+
* `command` - (Required)Command to be executed
141+
* `shell` - Type of shell. Valid values are `[bash, shell, expect, ps, psd]`
142+
* `credentials_env_vars` - List of environment variables that will contain credentials for this operation
143+
* `base_var_name` - Base name of the environment variables. Variables are named by appending '_USER', '_PASSWORD', '_PUBKEY' and '_PRIVKEY' to this base name, respectively. Variables whose values are not entered or are not present in the type of credential or vault selected, will not be set.
144+
* `password` - Password to assign to the environment variables.
145+
* `vault` - The name or reference of the vault to assign to the environment variables.
146+
* `hashicorp_vault_engine` - Vault engine name where the credential is stored.
147+
* `hashicorp_vault_secret_path` - Path in the vault engine where the credential is stored.
148+
* `hashicorp_vault_username_key` - Hashicorp vault key for the username in the key-value store.
149+
* `hashicorp_vault_secret_key` - Hashicorp vault key for the password in the key-value store.
150+
* `azure_vault_name` - Azure key vault name.
151+
* `azure_vault_username_key` - Azure vault key in the key-value store.
152+
* `azure_vault_secret_key` - Azure vault key in the key-value store.
153+
* `cyberark_vault_query_string` - Query to find a credential in the CyberArk vault.
154+
155+
* `ops_pre_sync` - (Optional) Operations to perform after syncing a created dSource.
156+
* `name` - Name of the hook
157+
* `command` - (Required)Command to be executed
158+
* `shell` - Type of shell. Valid values are `[bash, shell, expect, ps, psd]`
159+
* `credentials_env_vars` - List of environment variables that will contain credentials for this operation
160+
* `base_var_name` - Base name of the environment variables. Variables are named by appending '_USER', '_PASSWORD', '_PUBKEY' and '_PRIVKEY' to this base name, respectively. Variables whose values are not entered or are not present in the type of credential or vault selected, will not be set.
161+
* `password` - Password to assign to the environment variables.
162+
* `vault` - The name or reference of the vault to assign to the environment variables.
163+
* `hashicorp_vault_engine` - Vault engine name where the credential is stored.
164+
* `hashicorp_vault_secret_path` - Path in the vault engine where the credential is stored.
165+
* `hashicorp_vault_username_key` - Hashicorp vault key for the username in the key-value store.
166+
* `hashicorp_vault_secret_key` - Hashicorp vault key for the password in the key-value store.
167+
* `azure_vault_name` - Azure key vault name.
168+
* `azure_vault_username_key` - Azure vault key in the key-value store.
169+
* `azure_vault_secret_key` - Azure vault key in the key-value store.
170+
* `cyberark_vault_query_string` - Query to find a credential in the CyberArk vault.
171+
172+
* `excludes` - (Optional) List of subdirectories in the source to exclude when syncing data.These paths are relative to the root of the source directory. [AppDataDirect only]
173+
174+
* `parameters` - (Optional) The JSON payload conforming to the DraftV4 schema based on the type of application data being manipulated.
175+
176+
* `sync_parameters` - (Optional) The JSON payload conforming to the snapshot parameters definition in a LUA toolkit or platform plugin.

examples/dsource/main.tf

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,61 @@ provider "delphix" {
1818
}
1919

2020

21+
# resource "delphix_appdata_dsource" "test_app_data_dsource" {
22+
# source_id = "1-APPDATA_STAGED_SOURCE_CONFIG-6"
23+
# group_id = "1-GROUP-1"
24+
# log_sync_enabled = false
25+
# make_current_account_owner = true
26+
# link_type = "AppDataStaged"
27+
# name = "appdata_dsource"
28+
# staging_mount_base = ""
29+
# environment_user = "HOST_USER-2"
30+
# staging_environment = "1-UNIX_HOST_ENVIRONMENT-2"
31+
# parameters = jsonencode({
32+
# externalBackup : [],
33+
# delphixInitiatedBackupFlag : true,
34+
# delphixInitiatedBackup : [
35+
# {
36+
# userName : "delphix",
37+
# postgresSourcePort : 5432,
38+
# userPass : "delphix",
39+
# sourceHostAddress : "rhel-86-7vgs-qar-105196-27a4593a.dlpxdc.co"
40+
# }
41+
# ],
42+
# singleDatabaseIngestionFlag : false,
43+
# singleDatabaseIngestion : [],
44+
# stagingPushFlag : false,
45+
# postgresPort : 5433,
46+
# configSettingsStg : [],
47+
# mountLocation : "/tmp/delphix_mnt"
48+
# })
49+
# sync_parameters = jsonencode({
50+
# resync = true
51+
# })
52+
# }
2153

22-
resource "delphix_appdata_dsource" "test_app_data_dsource" {
23-
source_id = "1-APPDATA_STAGED_SOURCE_CONFIG-6"
24-
group_id = "1-GROUP-1"
54+
resource "delphix_appdata_dsource" "test_app_data_dsource_second" {
55+
source_id = "1-APPDATA_STAGED_SOURCE_CONFIG-7"
56+
group_id = ""
2557
log_sync_enabled = false
2658
make_current_account_owner = true
2759
link_type = "AppDataStaged"
28-
name = "appdata_dsource"
60+
name = "appdata_dsource_second"
2961
staging_mount_base = ""
3062
environment_user = "HOST_USER-2"
3163
staging_environment = "1-UNIX_HOST_ENVIRONMENT-2"
3264
parameters = jsonencode({
33-
externalBackup : [],
3465
delphixInitiatedBackupFlag : true,
3566
delphixInitiatedBackup : [
3667
{
37-
userName : "delphix",
68+
userName : "DELPHIX",
3869
postgresSourcePort : 5432,
39-
userPass : "delphix",
40-
sourceHostAddress : "rhel-86-7vgs-qar-105196-27a4593a.dlpxdc.co"
70+
userPass : "PASS",
71+
sourceHostAddress : "HOSTNAME"
4172
}
4273
],
43-
singleDatabaseIngestionFlag : false,
44-
singleDatabaseIngestion : [],
45-
stagingPushFlag : false,
4674
postgresPort : 5433,
47-
configSettingsStg : [],
48-
mountLocation : "/tmp/delphix_mnt"
75+
mountLocation : "/tmp/delphix_mnt_second"
4976
})
5077
sync_parameters = jsonencode({
5178
resync = true

0 commit comments

Comments
 (0)