Skip to content

[Bug]: linode_database_postgresql_v2 update arguments don't match docs #1979

@kti-matt

Description

@kti-matt

Terraform Version

1.12.2

Linode Provider Version

v3.1.0

Effected Terraform Resources

linode_database_postgresql_v2

Terraform Config Files

resource "linode_database_postgresql_v2" "linode-postgresql_v2" {
  [snip]
  updates = {
    frequency     = "weekly"
    duration      = 4
    hour_of_day   = var.update_hour
    day_of_week   = 6  # Saturday
  }
  [snip]
}

Debug Output

Case 1:
When updates.frequency is anything except weekly or duration is anything except 4, I get this AFTER the DB is provisioned, but this results in the resource being tainted and it needs to be replaced at the next apply

[400] [updates.frequency] Frequency must be weekly; [updates.duration] Duration must be 4

Case 2:

When updates.day_of_week is a string weekday name, I get this on apply before it tries to provision the resource, so it is never provisioned.

Inappropriate value for attribute "updates": a number is required.

Panic Output

No response

Expected Behavior

I expect the provisioning to succeed when I follow the docs at https://registry.terraform.io/providers/linode/linode/latest/docs/resources/database_postgresql_v2#day_of_week-4 - not just the example config, but the updates detailed documentation.

The docs are wrong or misleading in the following ways:

  • day_of_week: doc says it can be a string (ie monday) but it must be an integer.
  • duration: doc says values are 1..3, but actually the only valid value is 4. It's unclear what purpose the argument has if it only has one valid value- I guess it's just come across from the older resource.
  • frequency: doc only lists weekly as a valid value, so it's correct, but since this is different than the older resource, it would be helpful to point it out more prominently. Or remove it.

Actual Behavior

It failed with the output above in "debug output".

Steps to Reproduce

Answered elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugissues that report a bugkeepprevent github from closing issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions