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

RDS with HA fails to create #2472

Closed brunoagueda closed 7 months ago

brunoagueda commented 7 months ago

Terraform provider version

Terraform v1.7.3 on linux_amd64 provider registry.terraform.io/opentelekomcloud/opentelekomcloud v1.35.16

Affected Resource(s)

Terraform Configuration Files

resource "opentelekomcloud_rds_instance_v3" "instance" {
  name = "terraform_test_rds_instance"
  availability_zone = [var.availability_zone_1, var.availability_zone_2]

  db {
    password = var.rds_password
    type     = var.rds_type
    version  = var.rds_version
    port     = "8635"
  }

  security_group_id = var.secgroup_id
  subnet_id         = var.subnet_id
  vpc_id            = var.vpc_id
  flavor            = "rds.mysql.s3.4xlarge.2.ha"

  volume {
    type = "ULTRAHIGH"
    size = var.rds_volume_size
  }

  backup_strategy {
    start_time = "22:00-23:00"
    keep_days  = 1
  }
}

data "opentelekomcloud_rds_flavors_v3" "flavor" {
  db_type       = var.rds_type
  db_version    = var.rds_version
  instance_mode = "single"
}

Debug Output/Panic Output

https://gist.github.com/brunoagueda/038144ab85259fde2989ae095ccf37d4

Steps to Reproduce

  1. terraform apply

Expected Behavior

RDS being created

Actual Behavior

Error message: "Invalid AZ.","error_code":"DBS.280285"

Important Factoids

Removing one of the variables on the availability_zone paramater works, it only fails when I try to create with primary and standby instances. I wrote the code exactly as the documentation, I tried also some variations, but didn't work.

References

artem-lifshits commented 7 months ago

Hello @brunoagueda ha_replication_mode is required for primary/standby instances. I will update doc with this info.

brunoagueda commented 7 months ago

Hi @artem-lifshits Thanks for the clarification. I checked the updated doc and added the ha_replication_mode parameter. Now I can create the RDS instance with primary and standby, but on terraform I get a plugin crash error I'm still checking if I missed something, but I already posted the debug logs on this gist: https://gist.github.com/brunoagueda/852be6f8e559729710aaae0594fff573

artem-lifshits commented 7 months ago

@brunoagueda I was able to reproduce the issue, it's a provider bug caused by API differences between eu-de and eu-ch regions. For now you can switch to provider version 1.35.16 but it also have some version issue after RDS creation.

I'm going to test RDS thoroughly for eu-ch2 and release fixes on upcoming Thursday.

brunoagueda commented 7 months ago

@artem-lifshits thanks, with 1.35.16 version it worked

artem-lifshits commented 7 months ago

@brunoagueda fixes for Swisscloud are available in latest release.