opentelekomcloud / terraform-provider-opentelekomcloud

Terraform OpenTelekomCloud provider
https://registry.terraform.io/providers/opentelekomcloud/opentelekomcloud/latest
Mozilla Public License 2.0
87 stars 78 forks source link

opentelekomcloud_rds_parametergroup_v3 doesn't update the parameter groups attached to RDS instance #2169

Open EugenFo opened 1 year ago

EugenFo commented 1 year ago

Hello again. I've found an issue with the opentelekomcloud_rds_parametergroup_v3 resource. Modifying the values/parameters are only modified in the custom template, but not in the actual parameter group that is used by the RDS instance.

Terraform provider version

Terraform v1.4.6
on linux_amd64
+ provider registry.terraform.io/opentelekomcloud/opentelekomcloud v1.34.3
+ provider registry.terraform.io/terraform-provider-openstack/openstack v1.51.1

Affected Resource(s)

Terraform Configuration Files

resource "opentelekomcloud_rds_instance_v3" "this" {
  name = "test-rds"
  availability_zone = ["eu-de-01"]
  flavor = "rds.pg.c2.medium"
  security_group_id = module.sg-testing.this_security_group_id
  vpc_id = module.vpc.vpc_id[0]
  subnet_id = module.subnet.id

  db {
    password = "[REDACTED]"
    type = "PostgreSQL"
    version = "14"
    port = "5432"
  }

  volume {
    type = "ULTRAHIGH"
    size = "100"
  }
  param_group_id = opentelekomcloud_rds_parametergroup_v3.this.id
}

resource "opentelekomcloud_rds_parametergroup_v3" "this" {
  name        = "test-rds"

  values = {
    autovacuum_max_workers = "20"
  }

  datastore {
    type    = "PostgreSQL"
    version = "14"
  }
}

Debug Output/Panic Output

No output

Steps to Reproduce

  1. Create the RDS instance and the Parameter group with the example code above
  2. RDS parameter group has autovacuum_max_workers set to 20
  3. change autovacuum_max_workers = "20" to autovacuum_max_workers = "30" or similar and run terraform apply
  4. Modify was successful, but the parameter group attached to the RDS instance has still autovacuum_max_workers = "20"
  5. When you go to the Parameter Templates -> Custom Templates in the RDS overview and choose the created parameter group you will see that the value for autovacuum_max_workers is 30.

Expected Behavior

The parameter group that is attached to the RDS instance should be updated as the custom template did.

Actual Behavior

See Steps to Reproduce. We need to manually reapply the custom template to the RDS instance to update the modified values.

anton-sidelnikov commented 1 year ago

@EugenFo Hi, as workaround you can use parameters block inside rds instance resource:

  parameters = {
    max_prepared_transactions = "250"
    max_connections           = "300"
    autovacuum_max_workers    = "30"
  }

Need more time to investigate why parameter group not applied after changes.

anton-sidelnikov commented 1 year ago

https://jira.tsi-dev.otc-service.com/browse/BM-2138 - currently not possible to reapply configuration template to instance on changes, internal incident created, as workaround please use parameters block in opentelekomcloud_rds_instance_v3 resource, will add example in documentation.