Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coordinator_storage_quota_in_mb should be optional for azurerm_cosmosdb_postgresql_cluster when it's a read replica #23923

Closed
1 task done
leilifremont opened this issue Nov 16, 2023 · 2 comments · Fixed by #23938

Comments

@leilifremont
Copy link

leilifremont commented Nov 16, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.5.5

AzureRM Provider Version

3.76.0

Affected Resource(s)/Data Source(s)

azurerm_cosmosdb_postgresql_cluster

Terraform Configuration Files

resource "azurerm_resource_group" "rg" {
  name     = "testrg"
  location = "eastus"
}

resource "random_password" "cosmosdb_postgresql_passwords" {
  length           = 24
  min_upper        = 6
  min_lower        = 4
  min_numeric      = 6
  special          = false

  depends_on = [
    resource.azurerm_resource_group.rg
  ]
}

resource "azurerm_cosmosdb_postgresql_cluster" "primary_replica" {
  name                            = "primary"
  location                        = "eastus"
  resource_group_name             = azurerm_resource_group.rg.name
  administrator_login_password    = random_password.cosmosdb_postgresql_passwords.result
  coordinator_storage_quota_in_mb = 131072
  coordinator_vcore_count         = 2
  node_count                      = 2
  node_storage_quota_in_mb        = 131072
  node_vcores                     = 2
  node_server_edition             = "MemoryOptimized"

  coordinator_public_ip_access_enabled = false
  citus_version                        = "12.1"
  sql_version                          = "16"

  depends_on = [
    random_password.cosmosdb_postgresql_passwords
  ]
}

resource "time_sleep" "wait_20_minutes" {
  create_duration = "1200s"
  triggers = {
    postgresql_cluster_id  = azurerm_cosmosdb_postgresql_cluster.primary_replica.id
  }
}

resource "azurerm_cosmosdb_postgresql_cluster" "read_replica" {
  name                            = "secondary"
  resource_group_name             = azurerm_resource_group.rg.name
  location                        = "westus3"
  source_location      = azurerm_cosmosdb_postgresql_cluster.primary_replica.location
  source_resource_id   = azurerm_cosmosdb_postgresql_cluster.primary_replica.id
  administrator_login_password    = random_password.cosmosdb_postgresql_passwords.result
  coordinator_storage_quota_in_mb = 131072
  coordinator_vcore_count         = 2
  node_count                      = 2
  node_storage_quota_in_mb        = 131072
  node_vcores                     = 2
  node_server_edition             = "MemoryOptimized"

  coordinator_public_ip_access_enabled = true
  citus_version                        = "12.1"
  sql_version                          = "16"

  depends_on = [
    time_sleep.wait_20_minutes
  ]
}

Debug Output/Panic Output

│ Error: updating Server Groupsv 2 (Subscription: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
│ Resource Group Name: "PeterTest10252023"
│ Server Groupsv 2 Name: "peter1025secondary"): performing Update: unexpected status 400 with error: bad_request: Disk size cannot be updated on read replicas.
│
│   with azurerm_cosmosdb_postgresql_cluster.read_replica,
│   on main.tf line 107, in resource "azurerm_cosmosdb_postgresql_cluster" "read_replica":
│  107: resource "azurerm_cosmosdb_postgresql_cluster" "read_replica" {

Expected Behaviour

coordinator_storage_quota_in_mb should be optional for azurerm_cosmosdb_postgresql_cluster when it's a read replica.

I reported similar issue from here:
#23734

It seems there are other parameters should be optional for read replica of azurerm_cosmosdb_postgresql_cluster. For example, coordinator_vcore_count. Please check and fix those as well.

Actual Behaviour


│ Error: updating Server Groupsv 2 (Subscription: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
│ Resource Group Name: "PeterTest10252023"
│ Server Groupsv 2 Name: "peter1025secondary"): performing Update: unexpected status 400 with error: bad_request: Disk size cannot be updated on read replicas.

│ with azurerm_cosmosdb_postgresql_cluster.read_replica,
│ on main.tf line 107, in resource "azurerm_cosmosdb_postgresql_cluster" "read_replica":
│ 107: resource "azurerm_cosmosdb_postgresql_cluster" "read_replica" {

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@rcskosir
Copy link
Contributor

Thank you for taking the time to open this issue. Please subscribe to PR #23938 created by @neil-yechenwei for this issue.

Copy link

github-actions bot commented May 1, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants