Terraform: oneuptime_status_page_domain resource has schema and permission issues making it unusable #150

Closed
opened 2026-04-05 16:18:58 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @listellm on 1/19/2026

Summary

The oneuptime_status_page_domain Terraform resource has multiple issues that make it essentially unusable:

  1. cname_verification_token marked as Required but API generates it (causes inconsistent result error)
  2. full_domain marked as Required but API computes it (causes inconsistent result error)
  3. Read operation fails with 422 permission error when requesting cnameVerificationToken

Environment

  • Provider Version: v9.4.0
  • Terraform Version: 1.12.0
  • OS: Linux

Issue 1: cname_verification_token Marked as Required

Schema (resource_status_page_domain.go line 88-90):

"cname_verification_token": schema.StringAttribute{
    MarkdownDescription: "CNAME Verification Token",
    Required: true,
},

Behaviour: The API ignores user-provided values and generates its own UUID.

Error:

Error: Provider produced inconsistent result after apply

.cname_verification_token: was cty.StringVal("placeholder"), 
but now cty.StringVal("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").

Issue 2: full_domain Marked as Required

Schema (resource_status_page_domain.go line 84-86):

"full_domain": schema.StringAttribute{
    MarkdownDescription: "Full Domain",
    Required: true,
},

Behaviour: The API computes full_domain from subdomain + base domain.

Error:

Error: Provider produced inconsistent result after apply

.full_domain: was cty.StringVal("status.example.com"), 
but now cty.StringVal("subdomain.status.example.com").

Issue 3: Read Operation Fails with 422 (BLOCKING)

Code (resource_status_page_domain.go line 346):

selectParam := map[string]interface{}{
    ...
    "cnameVerificationToken": true,
    ...
}

Error:

Error: Parse Error

Unable to parse status_page_domain response, got error: API request failed
with status 422: {"error":"You do not have permissions to select on - cnameVerificationToken.
You need any one of these permissions: "}

This makes it impossible to run terraform plan or terraform apply - every operation fails during the refresh phase.

Steps to Reproduce

resource "oneuptime_status_page_domain" "example" {
  project_id     = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  domain_id      = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  status_page_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  
  subdomain                = "status"
  full_domain              = "example.com"
  cname_verification_token = "placeholder"
}
  1. Run terraform apply - resource creates but fails with inconsistent result
  2. Run terraform plan - fails with 422 permission error on Read

Proposed Fix

Schema Changes

"cname_verification_token": schema.StringAttribute{
    MarkdownDescription: "CNAME Verification Token (API-generated)",
    Computed: true,  // Change from Required
    PlanModifiers: []planmodifier.String{
        stringplanmodifier.UseStateForUnknown(),
    },
},
"full_domain": schema.StringAttribute{
    MarkdownDescription: "Full Domain (computed from subdomain + base domain)",
    Computed: true,  // Change from Required
    PlanModifiers: []planmodifier.String{
        stringplanmodifier.UseStateForUnknown(),
    },
},

Read Function

Remove cnameVerificationToken from the select query, or handle the 422 error gracefully.

This appears to be a similar pattern to:

  • #2226 (monitor inconsistent result)
  • #2228 (probe version inconsistent result)
  • #2232 (status_page inconsistent result)

The resource generator may not be correctly identifying computed fields.

*Originally created by @listellm on 1/19/2026* ## Summary The `oneuptime_status_page_domain` Terraform resource has multiple issues that make it essentially **unusable**: 1. `cname_verification_token` marked as `Required` but API generates it (causes inconsistent result error) 2. `full_domain` marked as `Required` but API computes it (causes inconsistent result error) 3. Read operation fails with 422 permission error when requesting `cnameVerificationToken` ## Environment - **Provider Version**: v9.4.0 - **Terraform Version**: 1.12.0 - **OS**: Linux ## Issue 1: cname_verification_token Marked as Required **Schema** (resource_status_page_domain.go line 88-90): ```go "cname_verification_token": schema.StringAttribute{ MarkdownDescription: "CNAME Verification Token", Required: true, }, ``` **Behaviour**: The API ignores user-provided values and generates its own UUID. **Error**: ``` Error: Provider produced inconsistent result after apply .cname_verification_token: was cty.StringVal("placeholder"), but now cty.StringVal("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"). ``` ## Issue 2: full_domain Marked as Required **Schema** (resource_status_page_domain.go line 84-86): ```go "full_domain": schema.StringAttribute{ MarkdownDescription: "Full Domain", Required: true, }, ``` **Behaviour**: The API computes `full_domain` from `subdomain` + base domain. **Error**: ``` Error: Provider produced inconsistent result after apply .full_domain: was cty.StringVal("status.example.com"), but now cty.StringVal("subdomain.status.example.com"). ``` ## Issue 3: Read Operation Fails with 422 (BLOCKING) **Code** (resource_status_page_domain.go line 346): ```go selectParam := map[string]interface{}{ ... "cnameVerificationToken": true, ... } ``` **Error**: ``` Error: Parse Error Unable to parse status_page_domain response, got error: API request failed with status 422: {"error":"You do not have permissions to select on - cnameVerificationToken. You need any one of these permissions: "} ``` This makes it **impossible to run `terraform plan` or `terraform apply`** - every operation fails during the refresh phase. ## Steps to Reproduce ```hcl resource "oneuptime_status_page_domain" "example" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" domain_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" status_page_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" subdomain = "status" full_domain = "example.com" cname_verification_token = "placeholder" } ``` 1. Run `terraform apply` - resource creates but fails with inconsistent result 2. Run `terraform plan` - fails with 422 permission error on Read ## Proposed Fix ### Schema Changes ```go "cname_verification_token": schema.StringAttribute{ MarkdownDescription: "CNAME Verification Token (API-generated)", Computed: true, // Change from Required PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, }, "full_domain": schema.StringAttribute{ MarkdownDescription: "Full Domain (computed from subdomain + base domain)", Computed: true, // Change from Required PlanModifiers: []planmodifier.String{ stringplanmodifier.UseStateForUnknown(), }, }, ``` ### Read Function Remove `cnameVerificationToken` from the select query, or handle the 422 error gracefully. ## Related Issues This appears to be a similar pattern to: - #2226 (monitor inconsistent result) - #2228 (probe version inconsistent result) - #2232 (status_page inconsistent result) The resource generator may not be correctly identifying computed fields.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#150