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

Support for analytical store in azurerm_cosmosdb_sql_container #10198

Closed
TobiTh opened this issue Jan 15, 2021 · 9 comments · Fixed by #11655
Closed

Support for analytical store in azurerm_cosmosdb_sql_container #10198

TobiTh opened this issue Jan 15, 2021 · 9 comments · Fixed by #11655

Comments

@TobiTh
Copy link

TobiTh commented Jan 15, 2021

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

Could you please add the possibility to enable the analytical store when creating a new sql container?
In Azure, you can enable it in the "create container" dialog:
image

New or Affected Resource(s)

  • azurerm_XXXXX

Potential Terraform Configuration

resource "azurerm_cosmosdb_sql_container" "example" {
  name                  = "example-container"
  resource_group_name   = azurerm_cosmosdb_account.example.resource_group_name
  account_name          = azurerm_cosmosdb_account.example.name
  database_name         = azurerm_cosmosdb_sql_database.example.name
  partition_key_path    = "/definition/id"
  partition_key_version = 1
  throughput            = 400
  enable_analytical_store = true #new

  indexing_policy {
    indexing_mode = "Consistent"

    included_path {
      path = "/*"
    }

    included_path {
      path = "/included/?"
    }

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

  unique_key {
    paths = ["/definition/idlong", "/definition/idshort"]
  }
}

References

The following pull request fixes the enabling of the analytical storage for a cosmosdb account (not a sql container)
#10055

@favoretti
Copy link
Collaborator

This one has been implemented and merged as part of #10055

@TobiTh
Copy link
Author

TobiTh commented Jan 19, 2021

@favoretti Yes, this enables the capability of analytical storage in the cosmosdb account. But we still need to enable the analytical store for each cosmosdb sql container seperately.

@favoretti
Copy link
Collaborator

favoretti commented Jan 19, 2021 via email

@T1loc
Copy link

T1loc commented Jan 20, 2021

This one has been implemented and merged as part of #10055

That's what I meant by the PR I didn't open.
The option shown by @TobiTh can only be define at container creation time.

There is also this parameter to take into account:
Screenshot 2021-01-20 at 10 46 07

@bm77525-kr
Copy link

It looks like the capability for this should be there in the current SDK if I'm reading it right. The other SDK's seem to enable this on containers by setting the analyticalStorageTtl property at creation. From the looks of the latest azurerm provider, it's using the 2020-04-01 API which supports that property. Does this just need to be exposed in the provider?

@FlipABit
Copy link
Contributor

@favoretti Sounds like this is potentially supported via the SDK that's currently in use now, yes?

@favoretti
Copy link
Collaborator

Yep, I'm happy to implement it, just trying to understand how the portal shows off/on (no default)/on as a choice and API has an integer as a value..

@favoretti
Copy link
Collaborator

Nevemind, tests showed how it works, which is sort of weird, but let me try an implementation.

katbyte pushed a commit that referenced this issue May 14, 2021
…nt (#11655)

```
$ TF_ACC=1 go test -v ./azurerm/internal/services/cosmos -timeout=1000m -run 'TestAccCosmosDbSqlContainer_analyticalStorageTTL'
2021/05/11 10:28:44 [DEBUG] not using binary driver name, it's no longer needed
2021/05/11 10:28:47 [DEBUG] not using binary driver name, it's no longer needed
=== RUN   TestAccCosmosDbSqlContainer_analyticalStorageTTL
=== PAUSE TestAccCosmosDbSqlContainer_analyticalStorageTTL
=== CONT  TestAccCosmosDbSqlContainer_analyticalStorageTTL
--- PASS: TestAccCosmosDbSqlContainer_analyticalStorageTTL (1009.36s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cosmos	1017.167s

```

Fixes #10198
favoretti added a commit to gro1m/terraform-provider-azurerm that referenced this issue May 26, 2021
…nt (hashicorp#11655)

```
$ TF_ACC=1 go test -v ./azurerm/internal/services/cosmos -timeout=1000m -run 'TestAccCosmosDbSqlContainer_analyticalStorageTTL'
2021/05/11 10:28:44 [DEBUG] not using binary driver name, it's no longer needed
2021/05/11 10:28:47 [DEBUG] not using binary driver name, it's no longer needed
=== RUN   TestAccCosmosDbSqlContainer_analyticalStorageTTL
=== PAUSE TestAccCosmosDbSqlContainer_analyticalStorageTTL
=== CONT  TestAccCosmosDbSqlContainer_analyticalStorageTTL
--- PASS: TestAccCosmosDbSqlContainer_analyticalStorageTTL (1009.36s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/cosmos	1017.167s

```

Fixes hashicorp#10198
@github-actions
Copy link

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 Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants