Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Unable to remove scopes on auth0_resource_server #289

Closed
multani opened this issue Nov 6, 2020 · 2 comments
Closed

Unable to remove scopes on auth0_resource_server #289

multani opened this issue Nov 6, 2020 · 2 comments

Comments

@multani
Copy link

multani commented Nov 6, 2020

Description

I created a resource server using an auth0_resource_server, with a few scopes configured.

After removing the scopes block, terraform apply says it will remove the scopes but they stay configured.

Subsequent terraform apply always show a plan where scopes will be removed, until new scopes are added (different plan), or scopes are manually removed from the Auth0 console.

Terraform Version

Terraform 0.13.5
+ provider.auth0 0.15.2

Affected Resource(s)

  • auth0_resource_server

Terraform Configuration Files

Initial configuration:

resource auth0_resource_server "test" {
  name       = "test123"
  identifier = "https://example.com"

  scopes {
    value       = "foo:bar"
    description = "bar the foo"
  }
}

Removing the scopes block doesn't delete the last, unique scope configured.

Expected Behavior

The last scope should be removed and subsequent plan should not show any difference.

Actual Behavior

The last scope stays configured, and Terraform always shows a difference and says it will remove the last scope.

Steps to Reproduce

  1. Create the a resource server with 1 scope defined
  2. terraform apply
  3. Remove the scope from the configuration
  4. terraform apply shows it will remove the scope
@alexkappa
Copy link
Owner

Hi @multani, if I'm not mistaken, this is caused by the scopes being tagged as json:",omitempty". This means empty slices don't get marshaled.

With go-auth0 v5 we should be able to finally overcome such limitations by handling the removal of scopes outside of the Update method.

@sergiught
Copy link
Collaborator

This relates to several other issues that are present within the provider and I have captured this along with the others within auth0/terraform-provider-auth0#14.

As this repo has moved over at https://github.com/auth0/terraform-provider-auth0 please open new issues over there from now on.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants