Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aiven_pg: Properties in pg_user_config.pg are not Lifecycle Managed Correctly #1804

Open
X-Guardian opened this issue Aug 6, 2024 · 3 comments

Comments

@X-Guardian
Copy link

Scenario 1

What happened?

If an aiven_pg Terraform resource pg_user_config.pg option is applied and then subsequently removed, a terraform plan shows no changes.

e.g.

Initial Configuration

resource "aiven_pg" "pg" {
  project      = data.aiven_project.pr1.project
  cloud_name   = "google-europe-west1"
  plan         = "startup-4"
  service_name = "my-pg1"
  pg_user_config {
    pg {
      log_min_duration_statement = -1
      bgwriter_delay             = 250
    }
  }
}

Updated Configuration

resource "aiven_pg" "pg" {
  project      = data.aiven_project.pr1.project
  cloud_name   = "google-europe-west1"
  plan         = "startup-4"
  service_name = "my-pg1"
  pg_user_config {
    pg {
      bgwriter_delay = 250
    }
  }
}

What did you expect to happen?

The terraform plan should show the removal of the option.

Scenario 2

What happened?

If a Postgres service pg advanced configuration option is configured within the Aiven UI but the option is not specified within the pg_user_config.pg block in an associated aiven_pg Terraform resource configuration, a terraform plan shows no changes.

What did you expect to happen?

The terraform plan should show the removal of the option.

What else do we need to know?

Aiven Terraform Provider version: 4.22.0

@byashimov
Copy link
Contributor

byashimov commented Aug 13, 2024

Hey, thank you for the report!
The API doesn't allow the removal of existing configurations—TF can only override them. So, there's not much we can do here. The UI also can't remove set options.
image

@X-Guardian
Copy link
Author

Thanks for the response @byashimov. Can I suggest that documentation is added to the resource property detailing this, and even better would be warnings from the provider when this scenario occurs.

@byashimov
Copy link
Contributor

Hey @rsalevsky, @staceysalamon-aiven! Please take a look at this 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants