From 03aefc72076928c51d25d277dd65b5b5fa0e4d62 Mon Sep 17 00:00:00 2001 From: Oleg Andriianov Date: Thu, 2 Jun 2022 11:58:02 +0000 Subject: [PATCH] Merge pull request #612 in CLOUD/terraform-provider-yandex-mirror from fix-datatransfer-terraform-acceptance-test to master Squashed commit of the following: commit 077599755bc3f21c54d1d81ac97dbe09ea8f2ead Author: Oleg Andriyanov Date: Tue May 31 15:24:05 2022 +0300 [CLOUD-94639] Fix datatransfer terraform acceptance test --- ...resource_yandex_datatransfer_transfer_test.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/yandex/resource_yandex_datatransfer_transfer_test.go b/yandex/resource_yandex_datatransfer_transfer_test.go index 031e73bf6..0fdcb5d5a 100644 --- a/yandex/resource_yandex_datatransfer_transfer_test.go +++ b/yandex/resource_yandex_datatransfer_transfer_test.go @@ -142,7 +142,8 @@ func TestAccDataTransferTransfer_full(t *testing.T) { resource.TestCheckResourceAttr(targetEndpointResourceName, "name", defaultTemplateParams.TargetEndpointName), resource.TestCheckResourceAttr(targetEndpointResourceName, "description", defaultTemplateParams.TargetEndpointDescription), resource.TestCheckResourceAttr(targetEndpointResourceName, "settings.0.postgres_target.0.password.0.raw", defaultTemplateParams.TargetEndpointPassword), - resource.TestCheckResourceAttr(targetEndpointResourceName, "settings.0.postgres_target.0.connection.0.mdb_cluster_id", defaultTemplateParams.TargetEndpointMDBClusterID), + resource.TestCheckResourceAttr(targetEndpointResourceName, "settings.0.postgres_target.0.connection.0.on_premise.0.hosts.0", defaultTemplateParams.TargetEndpointHostName), + resource.TestCheckResourceAttr(targetEndpointResourceName, "settings.0.postgres_target.0.connection.0.on_premise.0.port", strconv.Itoa(defaultTemplateParams.TargetEndpointPort)), resource.TestCheckResourceAttr(transferResourceName, "name", defaultTemplateParams.TransferName), resource.TestCheckResourceAttr(transferResourceName, "description", defaultTemplateParams.TransferDescription), @@ -216,7 +217,8 @@ type dataTransferTerraformTemplateParams struct { TargetEndpointName string TargetEndpointDescription string TargetEndpointPassword string - TargetEndpointMDBClusterID string + TargetEndpointHostName string + TargetEndpointPort int TransferName string TransferDescription string } @@ -231,7 +233,8 @@ var defaultTemplateParams = dataTransferTerraformTemplateParams{ TargetEndpointName: "datatransfer-dst-endpoint" + randomPostfix, TargetEndpointDescription: "dst description", TargetEndpointPassword: "dst password", - TargetEndpointMDBClusterID: "dst cluster id", + TargetEndpointHostName: "dst hostname", + TargetEndpointPort: 5432, TransferName: "datatransfer-transfer" + randomPostfix, TransferDescription: "transfer description", } @@ -292,7 +295,12 @@ func testAccDataTransferConfigMain(templateParams dataTransferTerraformTemplateP settings { postgres_target { connection { - mdb_cluster_id = "{{.TargetEndpointMDBClusterID}}" + on_premise { + hosts = [ + "{{.TargetEndpointHostName}}" + ] + port = {{.TargetEndpointPort}} + } } database = "postgres" user = "postgres"