diff --git a/client/configuration_set.go b/client/configuration_set.go index 9bd22ae1..ad912984 100644 --- a/client/configuration_set.go +++ b/client/configuration_set.go @@ -21,15 +21,17 @@ type UpdateConfigurationSetPayload struct { } type ConfigurationSet struct { - Id string `json:"id"` - Name string `json:"name"` - Description string `json:"description"` - AssignmentScope string `json:"assignmentScope"` - CreationScopeId string `json:"creationScopeId"` + Id string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + AssignmentScope string `json:"assignmentScope"` + CreationScopeId string `json:"creationScopeId"` + AssignmentScopeId string `json:"assignmentScopeId"` } func (client *ApiClient) ConfigurationSetCreate(payload *CreateConfigurationSetPayload) (*ConfigurationSet, error) { var result ConfigurationSet + var err error if payload.Scope == "organization" && payload.ScopeId == "" { diff --git a/env0/resource_variable_set_assignment.go b/env0/resource_variable_set_assignment.go index b5176ee6..90f15814 100644 --- a/env0/resource_variable_set_assignment.go +++ b/env0/resource_variable_set_assignment.go @@ -194,7 +194,7 @@ func resourceVariableSetAssignmentRead(ctx context.Context, d *schema.ResourceDa } // Filter out inherited assignments (e.g parent project). - if apiConfigurationSet.CreationScopeId != assignmentSchema.ScopeId { + if apiConfigurationSet.AssignmentScopeId != assignmentSchema.ScopeId { continue } diff --git a/env0/resource_variable_set_assignment_test.go b/env0/resource_variable_set_assignment_test.go index 179c2df2..26fb6388 100644 --- a/env0/resource_variable_set_assignment_test.go +++ b/env0/resource_variable_set_assignment_test.go @@ -20,46 +20,46 @@ func TestUnitVariableSetAssignmentResource(t *testing.T) { setIds := []string{"a1", "a2"} configurationSetIds := []client.ConfigurationSet{ { - Id: "a1", - AssignmentScope: scope, - CreationScopeId: scopeId, + Id: "a1", + AssignmentScope: scope, + AssignmentScopeId: scopeId, }, { - Id: "a2", - AssignmentScope: scope, - CreationScopeId: scopeId, + Id: "a2", + AssignmentScope: scope, + AssignmentScopeId: scopeId, }, { - Id: "filtered_out", - AssignmentScope: scope, - CreationScopeId: "otherCreationScopeId", + Id: "filtered_out", + AssignmentScope: scope, + AssignmentScopeId: "otherAssignmentScopeId", }, } // Validates that drifts do not occur due to ordering. flippedConfigurationSetIds := []client.ConfigurationSet{ { - Id: "a2", - AssignmentScope: scope, - CreationScopeId: scopeId, + Id: "a2", + AssignmentScope: scope, + AssignmentScopeId: scopeId, }, { - Id: "a1", - AssignmentScope: scope, - CreationScopeId: scopeId, + Id: "a1", + AssignmentScope: scope, + AssignmentScopeId: scopeId, }, } updatedSetIds := []string{"a1", "a3"} updatedConfigurationSetIds := []client.ConfigurationSet{ { - Id: "a3", - AssignmentScope: scope, - CreationScopeId: scopeId, + Id: "a3", + AssignmentScope: scope, + AssignmentScopeId: scopeId, }, { - Id: "a1", - AssignmentScope: scope, - CreationScopeId: scopeId, + Id: "a1", + AssignmentScope: scope, + AssignmentScopeId: scopeId, }, } @@ -114,14 +114,14 @@ func TestUnitVariableSetAssignmentResource(t *testing.T) { setIds := []string{"a1"} configurationSetIds := []client.ConfigurationSet{ { - Id: "a1", - AssignmentScope: scope, - CreationScopeId: scopeId, + Id: "a1", + AssignmentScope: scope, + AssignmentScopeId: scopeId, }, { - Id: "a2", - AssignmentScope: scope, - CreationScopeId: scopeId, + Id: "a2", + AssignmentScope: scope, + AssignmentScopeId: scopeId, }, }