|
| 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. |
0 commit comments