From 457a6d292c76a9447e77df995bb1581ead87b6aa Mon Sep 17 00:00:00 2001 From: Patrick Cowland <44225864+patrickcping@users.noreply.github.com> Date: Thu, 15 Aug 2024 19:31:00 +0100 Subject: [PATCH] Update pingone provider in acctests (#349) * Update pingone provider in acctests * hcl var correction --- 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..20ad9243 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 = %[6]s + } + ]) } `, 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