Skip to content

Commit

Permalink
Merge pull request #79 from DopplerHQ/rgharris/proj-memb-env-set
Browse files Browse the repository at this point in the history
Ignore order of project_member environments
  • Loading branch information
nmanoogian authored Mar 1, 2024
2 parents c101141 + 83a3fa2 commit 4aaa818
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/resources/project_member_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/project_member_service_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions doppler/resource_project_member.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 4aaa818

Please sign in to comment.