kislerdm / terraform-provider-neon

Terraform provider to manage Neon SaaS resources
https://registry.terraform.io/providers/kislerdm/neon/latest/docs
Mozilla Public License 2.0
28 stars 10 forks source link

Always error when re-applying #40

Closed kirinnee closed 11 months ago

kirinnee commented 1 year ago

Hi there,

Thank you for opening an issue.

Terraform Version

Terraform v1.5.3
on darwin_arm64
+ provider registry.terraform.io/cloudflare/cloudflare v4.13.0
+ provider registry.terraform.io/dopplerhq/doppler v1.2.3
+ provider registry.terraform.io/hashicorp/aws v5.13.1
+ provider registry.terraform.io/kislerdm/neon v0.2.1
+ provider registry.terraform.io/koslib/planetscale v0.6.0
+ provider registry.terraform.io/upstash/upstash v1.4.1

Your version of Terraform is out of date! The latest version
is 1.5.5. You can update by downloading from https://www.terraform.io/downloads.html

Provider Version

0.2.1

Affected Resource(s)

Please list the resources as a list, for example:

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "neon_project" "this" {
  name                = local.lpsd
  region_id           = var.region
  compute_provisioner = "k8s-neonvm"

  history_retention_seconds = var.history_retention_seconds

  default_endpoint_settings {
    autoscaling_limit_max_cu = var.max_cpu
    autoscaling_limit_min_cu = var.min_cpu
    suspend_timeout_seconds  = var.suspend_timeout
  }
}

resource "neon_role" "this" {
  name       = "admin"
  branch_id  = neon_project.this.default_branch_id
  project_id = neon_project.this.id
}

resource "neon_database" "this" {
  name       = var.database_name
  owner_name = neon_role.this.name
  branch_id  = neon_project.this.default_branch_id
  project_id = neon_project.this.id
}

Debug Output

https://gist.github.com/kirinnee/3e1654aabd622623b1f0b2b6f5a35dc6#file-gistfile1-txt

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

should not have failed

Actual Behavior

failed

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. after succeeded, literally re-run terraform apply

variables:

max_cpu = 2
min_cpu = 0.25
suspend_timeout = 3600
history_retention_seconds = 7 * 24 * 60 * 60

Important Factoids

Suspect its due tot the default value for history retention seconds is casted as int but attempt to read as int64 on line 153 in projects file. (or other way round)

References

nil

kislerdm commented 11 months ago

@kirinnee Hey Kirin, thank you for opening the issue. I will check it within a couple of days and come back with a headsup. Thank you for your patience!

kislerdm commented 11 months ago

@kirinnee Hey! A headsup: the issue was confirmed and root cause identified. New release with the fix will be delivered by 2023-09-20 EOB. Thanks!