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

DBaaS PostgreSQL unable to migrate from flavor {...} to flavor_id #304

Open
legioner0 opened this issue Oct 14, 2024 · 0 comments
Open

DBaaS PostgreSQL unable to migrate from flavor {...} to flavor_id #304

legioner0 opened this issue Oct 14, 2024 · 0 comments

Comments

@legioner0
Copy link

I have selectel_dbaas_postgresql_datastore_v1 cluster with flavor {...} block. For some reason I had to migrate to fixed configuration with known flavor_id. On second apply terraform fails on validation in API call.

Terraform Version

Terraform v1.9.7

Terraform Provider Selectel Version

5.4.0

Affected Resource(s)

  • at least selectel_dbaas_postgresql_datastore_v1

Terraform Configuration Files

Initial:

resource "selectel_dbaas_postgresql_datastore_v1" "datastore" {
    name        = "test1"
    node_count  = 1
    project_id  = "<sensitive value>"
    region      = "ru-2"
    subnet_id   = "<...>"
    type_id     = "b15e73d3-e585-4b6c-bc95-0b698de8f771" # PostgreSQL 14

    flavor {
        disk  = 32
        ram   = 4096
        vcpus = 1
       }

    pooler {
        mode = "transaction"
        size = 50
       }
   }

Edited:

resource "selectel_dbaas_postgresql_datastore_v1" "datastore" {
    name        = "test1"
    node_count  = 1
    project_id  = "<sensitive value>"
    region      = "ru-2"
    subnet_id   = "<...>"
    type_id     = "b15e73d3-e585-4b6c-bc95-0b698de8f771" # PostgreSQL 14

    flavor_id= "c41d8095-65bd-48d9-a5b6-2fa3c2ba064a"
    pooler {
        mode = "transaction"
        size = 50
       }
   }

Expected Behavior

changes applied without error

Actual Behavior

Second apply fail on validation in API call:

│ Error: error updating datastore '...': Bad Request: Validation failure: Only one of flavor or flavor_id may be specified. Code: 400

Steps to Reproduce

  1. terraform apply
  2. replace flavor {...} with flavor_id
  3. terraform apply
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

1 participant