From deb3f6b43795299403d449153c1a68c472e264ef Mon Sep 17 00:00:00 2001 From: Patrick Cowland Date: Thu, 15 Aug 2024 19:25:10 +0100 Subject: [PATCH 1/2] Update pingone provider in acctests --- internal/acctest/acctest.go | 29 ++++++++++++++--------------- internal/acctest/models.go | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index 14457208..ae2c681c 100644 --- a/internal/acctest/acctest.go +++ b/internal/acctest/acctest.go @@ -50,7 +50,7 @@ func init() { ExternalProviders = map[string]resource.ExternalProvider{ "pingone": { Source: "pingidentity/pingone", - VersionConstraint: ">= 0.25, < 1.0", + VersionConstraint: ">= 1.0, < 2.0", }, } } @@ -294,21 +294,20 @@ resource "pingone_environment" "%[1]s" { name = "tf-testacc-dv-dynamic-%[1]s" license_id = "%[2]s" - service { - type = "SSO" - } - service { - type = "DaVinci" - tags = %[6]s - } - - dynamic "service" { - for_each = toset(var.services_%[1]s) - - content { - type = service.key + services = concat([ + for serviceType in var.services_%[1]s : { + type = serviceType } - } + ], + [ + { + type = "SSO" + }, + { + type = "DaVinci" + tags = ["DAVINCI_MINIMAL"] + } + ]) } `, resourceName, licenseID, username, adminEnvID, servicesString, daVinciTags) } diff --git a/internal/acctest/models.go b/internal/acctest/models.go index d10902e6..812fbf1f 100644 --- a/internal/acctest/models.go +++ b/internal/acctest/models.go @@ -98,7 +98,7 @@ func (tcp TestConnection) MakeConnectionHcl() (hcl string) { } hcl = fmt.Sprintf(` resource "davinci_connection" "%[2]s" { - environment_id = resource.pingone_role_assignment_user.%[1]s.scope_environment_id + environment_id = resource.pingone_user_role_assignment.%[1]s.scope_environment_id connector_id = "%[3]s" name = "%[2]s" %[4]s From cd8de4948931714aa96f6508260d42ec82d5ca1c Mon Sep 17 00:00:00 2001 From: Patrick Cowland Date: Thu, 15 Aug 2024 19:28:20 +0100 Subject: [PATCH 2/2] hcl var correction --- internal/acctest/acctest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/acctest/acctest.go b/internal/acctest/acctest.go index ae2c681c..20ad9243 100644 --- a/internal/acctest/acctest.go +++ b/internal/acctest/acctest.go @@ -305,7 +305,7 @@ resource "pingone_environment" "%[1]s" { }, { type = "DaVinci" - tags = ["DAVINCI_MINIMAL"] + tags = %[6]s } ]) }