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

auth0_client_grant does not change audience #186

Closed
ghost opened this issue Mar 25, 2020 · 3 comments · Fixed by #241
Closed

auth0_client_grant does not change audience #186

ghost opened this issue Mar 25, 2020 · 3 comments · Fixed by #241
Labels

Comments

@ghost
Copy link

ghost commented Mar 25, 2020

@adamu commented on Mar 12, 2020, 2:23 AM UTC:

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

v0.12.23

Affected Resource(s)

  • auth0_client_grant

Terraform Configuration Files

resource "auth0_client_grant" "foo_api_grant" {
  audience  = "https://bar/"
  client_id = "redacted"
  scope = []
}

Debug Output

auth0_client_grant.foo_api_grant: Modifying... [id=redacted]
2020/03/12 11:17:00 [DEBUG] auth0_client_grant.foo_api_grant: applying the planned Update change
2020/03/12 11:17:01 [WARN] Provider "registry.terraform.io/-/auth0" produced an unexpected new value for auth0_client_grant.foo_api_grant, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .audience: was cty.StringVal("http://bar/"), but now cty.StringVal("http://foo/")
auth0_client_grant.foo_api_grant: Modifications complete after 0s [id=redacted]

Expected Behavior

Terraform destroys the grant and creates a new one with the correct audience.

Actual Behavior

Tries to update in place, although the Auth0 API does not support this.

  # auth0_client_grant.foo_api_grant will be updated in-place
  ~ resource "auth0_client_grant" "foo_api_grant" {
      ~ audience  = "https://foo/" -> "https://bar/"
        client_id = "ASDFGHJKLQWERTYUIOP"
        id        = "redacted"
        scope     = []
    }

Steps to Reproduce

  1. change the audience
  2. terraform apply

Important Factoids

The Auth0 Management API does not support editing the audience field, so it's necessary to re-create the resource.

Here is the output from trying to change the audience via the API manually:

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Payload validation error: 'Additional properties not allowed: audience'.",
  "errorCode": "invalid_body"
}

This issue was moved by alexkappa from terraform-providers/terraform-provider-auth0#7.

@ghost
Copy link
Author

ghost commented Mar 25, 2020

@alexkappa commented on Mar 17, 2020, 10:00 PM UTC:

Should probably be easily solved by a ForceNew on the attribute. Thanks for reporting.

If you’re feeling up for a PR it would be much appreciated. Otherwise I might get to it soon enough

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity.
Stale issues will be closed after 5 days if no action is taken. If you
think this issue should not be closed, remove the stale label.

@alexkappa
Copy link
Owner

Hi @adamu, thank you for submitting this issue. My apologies for the delay in looking into it. I will be addressing this issue soon. Be on the lookout for a new release 🤞 .

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