From 83a3fa243e17992d79c99c9a217ac5a0c58d93ff Mon Sep 17 00:00:00 2001 From: Robert Harris Date: Thu, 22 Feb 2024 14:52:14 -0800 Subject: [PATCH] Ignore order of project_member environments Utilize a TypeSet. No change in usage. --- docs/resources/project_member_group.md | 2 +- docs/resources/project_member_service_account.md | 2 +- doppler/resource_project_member.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/resources/project_member_group.md b/docs/resources/project_member_group.md index 468b414..57f00f2 100644 --- a/docs/resources/project_member_group.md +++ b/docs/resources/project_member_group.md @@ -32,7 +32,7 @@ resource "doppler_project_member_group" "backend_engineering" { ### Optional -- `environments` (List of String) The environments in the project where this access will apply (null or omitted for roles with access to all environments) +- `environments` (Set of String) The environments in the project where this access will apply (null or omitted for roles with access to all environments) ### Read-Only diff --git a/docs/resources/project_member_service_account.md b/docs/resources/project_member_service_account.md index 91080f2..2c3c127 100644 --- a/docs/resources/project_member_service_account.md +++ b/docs/resources/project_member_service_account.md @@ -32,7 +32,7 @@ resource "doppler_project_member_service_account" "backend_ci" { ### Optional -- `environments` (List of String) The environments in the project where this access will apply (null or omitted for roles with access to all environments) +- `environments` (Set of String) The environments in the project where this access will apply (null or omitted for roles with access to all environments) ### Read-Only diff --git a/doppler/resource_project_member.go b/doppler/resource_project_member.go index ddbc921..b31f2ab 100644 --- a/doppler/resource_project_member.go +++ b/doppler/resource_project_member.go @@ -37,7 +37,7 @@ func (builder ResourceProjectMemberBuilder) Build() *schema.Resource { }, "environments": { Description: "The environments in the project where this access will apply (null or omitted for roles with access to all environments)", - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, @@ -67,7 +67,7 @@ func (builder ResourceProjectMemberBuilder) CreateContextFunc() schema.CreateCon project := d.Get("project").(string) role := d.Get("role").(string) - rawEnvironments := d.Get("environments").([]interface{}) + rawEnvironments := d.Get("environments").(*schema.Set).List() environments := make([]string, len(rawEnvironments)) for i, v := range rawEnvironments { environments[i] = v.(string) @@ -113,7 +113,7 @@ func (builder ResourceProjectMemberBuilder) UpdateContextFunc() schema.UpdateCon var environments []string if d.HasChange("environments") { - rawEnvironments := d.Get("environments").([]interface{}) + rawEnvironments := d.Get("environments").(*schema.Set).List() environments = make([]string, len(rawEnvironments)) for i, v := range rawEnvironments { environments[i] = v.(string)