scylladb / terraform-provider-scylladbcloud

Terraform provider for ScyllaDB Cloud.
https://registry.terraform.io/providers/scylladb/scylladbcloud/latest
Apache License 2.0
11 stars 10 forks source link

internal/provider: inconsistent datacenter references #130

Closed dkropachev closed 8 months ago

dkropachev commented 8 months ago

Currently referring to a concrete datacenter is not consistent across the codebase and practically broken in one case.

Broken part:

  1. scylladbcloud_cluster resource, does not have datacenter_id field, while it is used by scylladbcloud_cql_auth

Inconsistency:

  1. scylladbcloud_vpc_peering resource uses datacenter, while scylladbcloud_cql_auth uses datacenter_id

To address that we need to decide on whether we use datacenter or datacenter_id and fix code accordingly.

rjeczalik commented 8 months ago

Now I see the issue, scylladbcloud_cluster does have datacenter field, same as scylladbcloud_vpc_peering.

So let's remove datacenter_id field, introduce datacenter attribute in the scylladbcloud_cql_auth resource, and also let's increase its schema version + implement a state upgrade (which will migrate datacenter_id -> datacenter).