alekc / terraform-provider-auth0

Mozilla Public License 2.0
18 stars 7 forks source link

Branding / custom font block irregularities #34

Open raimohanska opened 2 years ago

raimohanska commented 2 years ago

Description

Using auth0_branding resource without a font block, when running a terraform plan after a successful resource creation, I always get this:

  # module.auth0.auth0_branding.hedera will be updated in-place
  ~ resource "auth0_branding" "hedera" {
        id       = "terraform-20211111072023324000000001"
        # (1 unchanged attribute hidden)

      - font {}
        # (1 unchanged block hidden)
    }

The point being that it seems to want to remove the font block. After a consecutive apply then next plan will still want to do this change.

I tried to use an empty font {} block as a workaround, but that doesnt' cut it. Even though it works when running plan (no changes), it will fail when there are any other changes to branding. Here's an example output from apply when trying with an empty font block:

╷
│ Error: 400 Bad Request: Payload validation error: 'Too few properties defined (0), minimum 1' on property font (Custom font settings).
│ 
│   with module.auth0.auth0_branding.hedera,
│   on ../../modules/auth0/auth0.tf line 77, in resource "auth0_branding" "hedera":
│   77: resource "auth0_branding" "hedera" {
│ 
╵

Terraform Version

Terraform v1.0.9
on darwin_amd64
+ provider registry.terraform.io/alekc/auth0 v1.1.2
+ provider registry.terraform.io/hashicorp/aws v3.64.2
+ provider registry.terraform.io/hashicorp/external v2.1.0

Affected Resource(s)

auth0_branding

Terraform Configuration Files

Expected Behavior

In plan, it shouldn't detect a change when missing the font block. When applying with an empty font block, it should result to the similar state as without the font block.

Actual Behavior

Change always detected without a font block. Fails to apply with empty font block.

Community Note

alekc commented 2 years ago

Thanks for opening this. By the first glance it might be due to how the sdk is structured, I will have a look and write back shortly.

adomokos commented 2 years ago

I've been bumping into the same issue.

raimohanska commented 2 years ago

Any update on this one?