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

Error reading Throughput on azurerm_cosmosdb_sql_container when Serverless #9338

Closed
mariussm opened this issue Nov 16, 2020 · 2 comments
Closed

Comments

@mariussm
Copy link
Contributor

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

Terraform (and AzureRM Provider) Version

Terraform 0.13.5
AzureRM 2.35.0

Affected Resource(s)

  • azurerm_cosmosdb_sql_container

Terraform Configuration Files

Debug Output

Panic Output

Error reading Throughput on Cosmos SQL Container policyresult (Account: "xxxxx", Database: "xxxxx") ID: documentdb.SQLResourcesClient#GetSQLContainerThroughput: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="Message: {"code":"BadRequest","message":"Reading or replacing offers is not supported for serverless accounts.\r\nActivityId: 9ed7d9ce-35b3-47a7-9662-27ccb7db48ba, Microsoft.Azure.Documents.Common/2.11.0"}, Request URI: /offers, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.11.0"

Expected Behaviour

After AzureRM 2.35.0, with a fix to azurerm_cosmosdb_sql_database, serverless is working. However, contains show the same issue. Expected behavoir is that the containers can be created.

Actual Behaviour

Steps to Reproduce

  • Deploy a azurerm_cosmosdb_account with EnableServerless capability
resource "azurerm_cosmosdb_account" "db" {
  name                = "${var.prefix}-${var.environment}-cosmosdb-${var.suffix}"
  location            = azurerm_resource_group.rg.location
  resource_group_name = azurerm_resource_group.rg.name
  offer_type          = "Standard"
  kind                = "GlobalDocumentDB"

  enable_automatic_failover = true

  capabilities {
    name = "EnableServerless"
  }

  consistency_policy {
    consistency_level       = "BoundedStaleness"
    max_interval_in_seconds = 10
    max_staleness_prefix    = 200
  }

  geo_location {
    location          = azurerm_resource_group.rg.location
    failover_priority = 0
  }
}
  • Deploy a database
resource "azurerm_cosmosdb_sql_database" "db" {
  name                = "${var.prefix}-${var.environment}-cosmossql-${var.suffix}"
  resource_group_name = azurerm_cosmosdb_account.db.resource_group_name
  account_name        = azurerm_cosmosdb_account.db.name
}
  • Deploy a azurerm_cosmosdb_sql_container:
resource "azurerm_cosmosdb_sql_container" "policyresult" {
  name                = "policyresult"
  resource_group_name = azurerm_cosmosdb_account.db.resource_group_name
  account_name        = azurerm_cosmosdb_account.db.name
  database_name       = azurerm_cosmosdb_sql_database.db.name
  partition_key_path  = "/module"

  indexing_policy {
    indexing_mode = "Consistent"

    included_path {
      path = "/*"
    }

    included_path {
      path = "/included/?"
    }

    excluded_path {
      path = "/excluded/?"
    }
  }

  unique_key {
    paths = []
  }
}

Important Factoids

Nothing

References

@mariussm
Copy link
Contributor Author

It seems this is already adressed in #9311

@ghost
Copy link

ghost commented Dec 16, 2020

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant