Skip to content

history_limit_days is imported as 0 when set to "No Limit" in Terraform Import, causing an error #33

@Niwa-Sato

Description

@Niwa-Sato

Overview

When the "Incident history limit" in the StatusPal management dashboard's status page settings is set to "No Limit", running terraform import imports the following value:

history_limit_days = 0

Subsequently, running terraform plan produces the following error:

Attribute status_page.history_limit_days value must be one of: ["30" "90" "365"], got: 0

Details

  • Expected Behavior:

    • Terraform should correctly process the "No Limit" setting, either omitting history_limit_days or interpreting it appropriately as "No Limit" so that the plan runs successfully without errors.
  • Actual Behavior:

    • After running terraform import, history_limit_days = 0 is imported.
    • When running terraform plan, the above error is raised, causing the plan to fail.

According to the official documentation, the "No Limit" option allows history_limit_days to be omitted. However, when omitted, the default value appears to be 90. Therefore, even when attempting to set "No Limit," terraform import incorrectly assigns 0, causing an error during the plan phase.

Steps to Reproduce

  1. Set the "Incident history limit" to "No Limit" in the StatusPal management dashboard.
  2. Import the corresponding status page resource using terraform import.
  3. Check the Terraform configuration after the import, which will show history_limit_days = 0.
  4. Run terraform plan and observe the following error:
    Attribute status_page.history_limit_days value must be one of: ["30" "90" "365"], got: 0
    

Environment Information

  • Terraform Version: 1.9.5
  • Terraform Provider (StatusPal) Version: 0.3.0
  • StatusPal Setting: Incident history limit = "No Limit"
  • OS / Execution Environment: macOS 14.7.2

Expected Fix

  • The Terraform Provider should correctly handle "No Limit" by ensuring history_limit_days is either omitted or treated as "No Limit" when imported.
  • The behavior should align with the official documentation, where the "No Limit" setting allows history_limit_days to be omitted. The default value (90) should not be applied, and no errors should occur during plan or apply.

Notes & Suggestions

  • Ideally, the Terraform Provider should support the omission of history_limit_days as described in the documentation.
  • If a special value (e.g., null or -1) is needed to represent "No Limit," this handling should be clearly documented for user clarity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions