supabase / terraform-provider-supabase

Mozilla Public License 2.0
22 stars 7 forks source link

Changing project database password fails #90

Open adamstoffel opened 3 months ago

adamstoffel commented 3 months ago

Bug report

Describe the bug

When rotating a password automatically with Terraform (e.g. the below), the supabase terraform provider fails:

resource "time_rotating" "supabase_password_rotation" {
  rotation_days = 90
}

resource "random_password" "supabase_password" {
  length           = 48
  special          = true
  override_special = "_"
}

resource "supabase_project" "my_project" {
  organization_id   = var.supabase_organization_id
  name              = var.project_name
  database_password = random_password.supabase_password.result
  region            = "us-west-1"
  instance_size     = "micro"
}

Terraform error:

╷
│ Error: Client Error
│ 
│   with supabase_project.my_project,
│   on supabase.tf line 19, in resource "supabase_project" "my_project":
│   19: resource "supabase_project" "my_project" {
│ 
│ Update is not supported for project resource: <supabase project ref redacted>
╵
Operation failed: failed running terraform apply (exit 1)
Error: Process completed with exit code 1.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

Create terraform file with the above configuration (change rotation to a few sec or minutes)

Expected behavior

Terraform should successfully change the DB password

System information

Terraform HCP Github actions

alleeclark commented 3 weeks ago

I am unable to get this to work even without changing the password. I am trying to create a project and it fails with the same error. On versions 1.0 and 1.4.