Skip to content

Commit

Permalink
Merge pull request #612 in CLOUD/terraform-provider-yandex-mirror fro…
Browse files Browse the repository at this point in the history
…m fix-datatransfer-terraform-acceptance-test to master

Squashed commit of the following:

commit 077599755bc3f21c54d1d81ac97dbe09ea8f2ead
Author: Oleg Andriyanov <[email protected]>
Date:   Tue May 31 15:24:05 2022 +0300

    [CLOUD-94639] Fix datatransfer terraform acceptance test
  • Loading branch information
ovandriyanov committed Jun 2, 2022
1 parent 68ad7eb commit 03aefc7
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions yandex/resource_yandex_datatransfer_transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -216,7 +217,8 @@ type dataTransferTerraformTemplateParams struct {
TargetEndpointName string
TargetEndpointDescription string
TargetEndpointPassword string
TargetEndpointMDBClusterID string
TargetEndpointHostName string
TargetEndpointPort int
TransferName string
TransferDescription string
}
Expand All @@ -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",
}
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 03aefc7

Please sign in to comment.