From c856da0883ec6fed0f125804127ad23f21ab0fc8 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Mon, 25 Sep 2023 16:14:32 +0800 Subject: [PATCH 1/2] azurerm_cosmosdb_postgresql_cluster - update the validation of sql_version and citus_version --- .../cosmos/cosmosdb_postgresql_cluster_resource.go | 2 ++ .../cosmosdb_postgresql_cluster_resource_test.go | 11 ++--------- .../docs/r/cosmosdb_postgresql_cluster.html.markdown | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/internal/services/cosmos/cosmosdb_postgresql_cluster_resource.go b/internal/services/cosmos/cosmosdb_postgresql_cluster_resource.go index 57fb801cd897..ba8cb8467efc 100644 --- a/internal/services/cosmos/cosmosdb_postgresql_cluster_resource.go +++ b/internal/services/cosmos/cosmosdb_postgresql_cluster_resource.go @@ -142,6 +142,7 @@ func (r CosmosDbPostgreSQLClusterResource) Arguments() map[string]*pluginsdk.Sch "11.1", "11.2", "11.3", + "12.1", }, false), }, @@ -289,6 +290,7 @@ func (r CosmosDbPostgreSQLClusterResource) Arguments() map[string]*pluginsdk.Sch "13", "14", "15", + "16", }, false), }, diff --git a/internal/services/cosmos/cosmosdb_postgresql_cluster_resource_test.go b/internal/services/cosmos/cosmosdb_postgresql_cluster_resource_test.go index 4d35e0416d0e..613b10f7c1d8 100644 --- a/internal/services/cosmos/cosmosdb_postgresql_cluster_resource_test.go +++ b/internal/services/cosmos/cosmosdb_postgresql_cluster_resource_test.go @@ -70,13 +70,6 @@ func TestAccCosmosDbPostgreSQLCluster_update(t *testing.T) { r := CosmosDbPostgreSQLClusterResource{} data.ResourceTest(t, r, []acceptance.TestStep{ - { - Config: r.complete(data), - Check: acceptance.ComposeTestCheckFunc( - check.That(data.ResourceName).ExistsInAzure(r), - ), - }, - data.ImportStep("administrator_login_password"), { Config: r.update(data), Check: acceptance.ComposeTestCheckFunc( @@ -226,7 +219,7 @@ resource "azurerm_cosmosdb_postgresql_cluster" "test" { coordinator_vcore_count = 4 node_count = 2 - citus_version = "11.3" + citus_version = "12.1" coordinator_public_ip_access_enabled = false ha_enabled = true coordinator_server_edition = "MemoryOptimized" @@ -239,7 +232,7 @@ resource "azurerm_cosmosdb_postgresql_cluster" "test" { node_public_ip_access_enabled = true node_server_edition = "GeneralPurpose" - sql_version = "15" + sql_version = "16" preferred_primary_zone = 2 node_storage_quota_in_mb = 262144 node_vcores = 4 diff --git a/website/docs/r/cosmosdb_postgresql_cluster.html.markdown b/website/docs/r/cosmosdb_postgresql_cluster.html.markdown index ba6f155555b1..a2d8e8c0fa85 100644 --- a/website/docs/r/cosmosdb_postgresql_cluster.html.markdown +++ b/website/docs/r/cosmosdb_postgresql_cluster.html.markdown @@ -49,7 +49,7 @@ The following arguments are supported: * `node_count` - (Required) The worker node count of the Azure Cosmos DB for PostgreSQL Cluster. Possible value is between `0` and `20` except `1`. -* `citus_version` - (Optional) The citus extension version on the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `8.3`, `9.0`, `9.1`, `9.2`, `9.3`, `9.4`, `9.5`, `10.0`, `10.1`, `10.2`, `11.0`, `11.1`, `11.2` and `11.3`. +* `citus_version` - (Optional) The citus extension version on the Azure Cosmos DB for PostgreSQL Cluster. Possible values are `8.3`, `9.0`, `9.1`, `9.2`, `9.3`, `9.4`, `9.5`, `10.0`, `10.1`, `10.2`, `11.0`, `11.1`, `11.2`, `11.3` and `12.1`. * `coordinator_public_ip_access_enabled` - (Optional) Is public access enabled on coordinator? Defaults to `true`. @@ -77,7 +77,7 @@ The following arguments are supported: * `source_resource_id` - (Optional) The resource ID of the source Azure Cosmos DB for PostgreSQL cluster for read replica clusters. Changing this forces a new resource to be created. -* `sql_version` - (Optional) The major PostgreSQL version on the Azure Cosmos DB for PostgreSQL cluster. Possible values are `11`, `12`, `13`, `14` and `15`. +* `sql_version` - (Optional) The major PostgreSQL version on the Azure Cosmos DB for PostgreSQL cluster. Possible values are `11`, `12`, `13`, `14`, `15` and `16`. * `tags` - (Optional) A mapping of tags which should be assigned to the Azure Cosmos DB for PostgreSQL Cluster. From 28ddabc41091bf7578a44564bf67e57e5e693080 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Sun, 8 Oct 2023 10:36:51 +0800 Subject: [PATCH 2/2] update code --- .../cosmos/cosmosdb_postgresql_cluster_resource_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/services/cosmos/cosmosdb_postgresql_cluster_resource_test.go b/internal/services/cosmos/cosmosdb_postgresql_cluster_resource_test.go index 613b10f7c1d8..74f24cb79655 100644 --- a/internal/services/cosmos/cosmosdb_postgresql_cluster_resource_test.go +++ b/internal/services/cosmos/cosmosdb_postgresql_cluster_resource_test.go @@ -70,6 +70,13 @@ func TestAccCosmosDbPostgreSQLCluster_update(t *testing.T) { r := CosmosDbPostgreSQLClusterResource{} data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.complete(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("administrator_login_password"), { Config: r.update(data), Check: acceptance.ComposeTestCheckFunc(