diff --git a/env0/resource_variable_set_assignment.go b/env0/resource_variable_set_assignment.go index f1785c7b..97901f33 100644 --- a/env0/resource_variable_set_assignment.go +++ b/env0/resource_variable_set_assignment.go @@ -2,7 +2,6 @@ package env0 import ( "context" - "strings" "github.com/env0/terraform-provider-env0/client" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" @@ -90,7 +89,7 @@ func resourceVariableSetAssignmentUpdate(ctx context.Context, d *schema.Resource // In API but not in Schema - delete. for _, apiConfigurationSet := range apiConfigurationSets { - if !strings.EqualFold(apiConfigurationSet.AssignmentScope, assignmentSchema.Scope) { + 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 26fb6388..8d3a8603 100644 --- a/env0/resource_variable_set_assignment_test.go +++ b/env0/resource_variable_set_assignment_test.go @@ -61,6 +61,11 @@ func TestUnitVariableSetAssignmentResource(t *testing.T) { AssignmentScope: scope, AssignmentScopeId: scopeId, }, + { + Id: "a1111", + AssignmentScope: scope, + AssignmentScopeId: "some other scope id", + }, } testCase := resource.TestCase{