ucloud / terraform-provider-ucloud

Terraform is an awesome tool to implement Infrastructure as Code and GitOps
https://www.terraform.io/docs/providers/ucloud/
Mozilla Public License 2.0
68 stars 22 forks source link

`ucloud_db_instance.instance_type` doc is missing PostgreSQL instance types #106

Open namoshizun opened 2 years ago

namoshizun commented 2 years ago

https://docs.ucloud.cn/terraform/specification/db_instance

It only tells instance types of MySQL and I couldn't find any type specifications for PostgreSQL...

shawnmssu commented 2 years ago

I'm sorry about that, we will update the document later. At present, you can refer to the console to get the instance_type of PostgreSQL.

namoshizun commented 2 years ago

@shawnmssu Hmmm I still cant find the literal representation (like, postgresql-ha-1) of PostgreSQL instance type on the console portal.. Could you point me out where the spec is?

shawnmssu commented 2 years ago

The instance_type of PostgreSQL just as you understand likepostgresql-ha-1 (engine-mode-memory), the spec is our docs, We just updated it .

namoshizun commented 2 years ago

@shawnmssu

Thx~ just now tried with the following script

resource "ucloud_db_instance" "psql" {
  name              = "${local.common_prefix}-psql"
  availability_zone = data.ucloud_zones.default_zone.zones[0].id
  instance_storage  = 40
  instance_type     = "postgresql-ha-2"
  engine            = "postgresql"
  engine_version    = "10.4"
  port              = "5432"
  password          = random_password.psql_password.result
  vpc_id            = ucloud_vpc.vpc.id
  subnet_id         = ucloud_subnet.subnet.id
  charge_type       = "dynamic"
}

But then got this


Error: error on creating db instance, api:
[server.RetCodeError] 7111 This DB type does not support HA instance

PS: changing instance version to "9.6" worked tho

namoshizun commented 2 years ago

@shawnmssu Another question. Is there "HA" the only supported type of instance? If I create the database via portal, both "HA" and "Normal" types are selectable

shawnmssu commented 2 years ago

Currently, our Terraform provider only supports the HA type of DB instance, about the Normal type we need to assess whether we need support.