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

EnableAnalyticalStorage capabilities not detected in resource azurerm_cosmosdb_account #9119

Closed
ghost opened this issue Nov 2, 2020 · 5 comments · Fixed by #10055
Closed

Comments

@ghost
Copy link

ghost commented Nov 2, 2020

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

Description

When the EnableAnalyticalStorage capability is already added to your azurerm_cosmosdb_account. Terraform plan doesn't detect it and try to recreate the resource with the capability enabled during the plan.

Affected Resource(s)

  • azurerm_cosmosdb_account

Terraform Configuration Files

resource "azurerm_cosmosdb_account" "acdb" {
  name                = local.resource_name
  location            = data.azurerm_resource_group.project_resource_group.location
  resource_group_name = data.azurerm_resource_group.project_resource_group.name
  offer_type          = var.acdb_offer_type
  kind                = var.acdb_kind
  ...

  capabilities {
    name = "EnableAnalyticalStorage"
  }

  ...

}

Plan Output

  + capabilities { # forces replacement
          + name = "EnableAnalyticalStorage"
      }

Expected Behavior

Terraform plan should have detected the already activated capability

Actual Behavior

Terraform want to recreate the complete resource to activate the capability

Steps to Reproduce

  1. terraform plan

Important Factoids

The last update (2.34) give us control to enable the capability you can find the link to the PR below
#9010

@DenWin
Copy link
Contributor

DenWin commented Nov 11, 2020

If you output the result of the data source, does it also outputs the "EnableAnalyticalStorage" capability?

data"azurerm_cosmosdb_account" "acdb" {
  name                = local.resource_name
  location            = data.azurerm_resource_group.project_resource_group.location
}

Assumably as it is this new the return is not properly implemented.

@ghost
Copy link
Author

ghost commented Nov 12, 2020

It is not declared in the list of capabilities either in the property during my plan.

In the ARM export in the portal, this capability(enableAnalyticalStorage) is declared as a property and not in the capabilities list

@favoretti
Copy link
Collaborator

@Philippe-Padok I'm trying to look into this, but API gives me

Error: Error creating CosmosDB Account "vlad-test-2" (Resource Group "vlad-test"): Error creating/updating CosmosDB Account "vlad-test-2" (Resource Group "vlad-test"): documentdb.DatabaseAccountsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="Invalid capability EnableAnalyticalStorage.\r\nActivityId: 00bb75d5-93a6-413e-ae33-5d10ce9c11b5, Microsoft.Azure.Documents.Common/2.11.0"

Did the creation snippet of terraform ever work for you? Cause as you say, it seems to be a property, hence I'm not sure how this could ever work at all..

@favoretti
Copy link
Collaborator

Nevermind, I see it now. Rewriting how it should be + a test.

@ghost
Copy link

ghost commented Feb 14, 2021

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 👉 hashibot-feedback@hashicorp.com. Thanks!

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

Successfully merging a pull request may close this issue.

3 participants