delphix-integrations / terraform-provider-delphix

Repository for Delphix Terraform Provider built on DCT APIs.
https://integrations.delphix.com
11 stars 9 forks source link

APIGW-799 VDB template parameter template_id throws api error #25

Closed eyalkaspi-delphix closed 2 years ago

eyalkaspi-delphix commented 2 years ago

The DCT VDBs API has changed in a non backwards compatible way (we shouldn't occur post-beta, but is accepted until GA).

In particular:

This change is therefore making terraform work with the latest DCT version (but breaks compatibility with DCT beta!).

While I was there, I've removed the job_id parameter from the schema which was declared but unused/unset.

Testing

Provisionned a VDB with and without specifying os_username and os_password and verified this was propagated to the engine (the VDB provisioned with os_username and os_password failed as I passed `root). Tested updating the vdb_name, template, listeners and db_username/db_password and verified via the engine UI and engine access_log the values were set.

Ran VDB acceptance tests:

TESTARGS="-run TestAccVdb_provision_positive" make testacc
TF_ACC=1 go test $(go list ./... | grep -v 'vendor') -v -run TestAccVdb_provision_positive -timeout 120m   
?       terraform-provider-delphix  [no test files]
=== RUN   TestAccVdb_provision_positive
[DELPHIX] [INFO] 2022/04/26 13:56:22 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:56:29 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:56:36 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:56:43 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:56:50 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:56:57 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:57:05 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:57:12 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:57:19 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:57:26 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:57:33 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:57:40 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:57:47 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:57:54 DCT-JobId:1-JOB-138 has Status:RUNNING
[DELPHIX] [INFO] 2022/04/26 13:58:01 DCT-JobId:1-JOB-138 has Status:COMPLETED
[DELPHIX] [INFO] 2022/04/26 13:58:01 Job result is COMPLETED
[DELPHIX] [INFO] 2022/04/26 13:58:02 [OK] Breaking poll - Status 200 reached.
[DELPHIX] [INFO] 2022/04/26 13:58:03 [OK] Breaking poll - Status 200 reached.
[DELPHIX] [INFO] 2022/04/26 13:58:04 [OK] Breaking poll - Status 200 reached.
[DELPHIX] [INFO] 2022/04/26 13:58:09 Job result is STARTED
[DELPHIX] [INFO] 2022/04/26 13:58:10 [OK] Breaking poll - Status 200 reached.
[DELPHIX] [INFO] 2022/04/26 13:58:12 [OK] Breaking poll - Status 200 reached.
[DELPHIX] [INFO] 2022/04/26 13:58:24 DCT-JobId:1-JOB-141 has Status:COMPLETED
[DELPHIX] [INFO] 2022/04/26 13:58:24 Job result is COMPLETED
[DELPHIX] [INFO] 2022/04/26 13:59:05 [OK] Breaking poll - Status 404 reached.
--- PASS: TestAccVdb_provision_positive (182.68s)
PASS
ok      terraform-provider-delphix/internal/provider    182.708s

Verified that provisioning a VDB cannot be done with db_username/db_password (values are inherited from the dsource at provisioning time).

Misc

This change depends on https://github.com/delphix/dct-sdk-go/pull/14, will update go.mod accordingly after having merged and released it.