Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore order of project_member environments #79

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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