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

New Resource: azurerm_cosmosdb_sql_container #3871

Merged
merged 19 commits into from
Aug 18, 2019

Conversation

DenheenJ
Copy link
Contributor

@DenheenJ DenheenJ commented Jul 18, 2019

Create resource that creates a cosmosdb sql container. Only creates the properties that cannot be changed after creation.

resource "azurerm_cosmosdb_sql_container" "test_container" {
  name                = "test-container"
  resource_group_name = "${azurerm_cosmosdb_account.test_cosmos_account.resource_group_name}"
  account_name        = "${azurerm_cosmosdb_account.test_cosmos_account.name}"
  database_name       = "${azurerm_cosmosdb_sql_database.test_db.name}"
  partition_key_paths = "/definition/id"
  unique_key_policy {
    unique_keys {
      paths = ["/definition/something", "/definition/somethingelse"]
    {
  }
}

creates unique key policy json as below

"uniqueKeyPolicy": {
  "uniqueKeys": [
    {
      "paths": [
        "/definition/something",
        "/definition/somethingelse"
      ]
    }
  ]
}

creates partition key json as below

"partitionKey": {
  "kind": "Hash",
  "paths": [
    "/definition/id"
  ]
},

@ghost ghost added the size/XL label Jul 18, 2019
@DenheenJ DenheenJ changed the title Adding base resource that can't be changed via powershell Add Resrouce azurerm_cosmosdb_sql_container Jul 19, 2019
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the new resource @DenheenJ,

Overall this is off to a great start. In addition to the comments i've left inline could we add documentation?

azurerm/resource_arm_cosmosdb_sql_container.go Outdated Show resolved Hide resolved
azurerm/resource_arm_cosmosdb_sql_container_test.go Outdated Show resolved Hide resolved
azurerm/resource_arm_cosmosdb_sql_container.go Outdated Show resolved Hide resolved
azurerm/resource_arm_cosmosdb_sql_container.go Outdated Show resolved Hide resolved
@ghost ghost added the documentation label Aug 3, 2019
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DenheenJ,

I hope you don't mind but i have pushed the required changes to get the merged for 1.33. I added some tests and slightly tweaked the schema to be a little simpler. LGTM now 👍

@katbyte katbyte changed the title Add Resrouce azurerm_cosmosdb_sql_container New Resource: azurerm_cosmosdb_sql_container Aug 18, 2019
@katbyte katbyte merged commit 889a98f into hashicorp:master Aug 18, 2019
katbyte added a commit that referenced this pull request Aug 18, 2019
@ghost
Copy link

ghost commented Aug 22, 2019

This has been released in version 1.33.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.33.0"
}
# ... other configuration ...

@ghost ghost removed the waiting-response label Aug 22, 2019
@sawyerh
Copy link

sawyerh commented Aug 28, 2019

@DenheenJ @katbyte Thanks for adding this! I'm not seeing azurerm_cosmosdb_sql_container in the documentation here, is that expected?

@DenheenJ
Copy link
Contributor Author

DenheenJ commented Sep 2, 2019

@sawyerh https://www.terraform.io/docs/providers/azurerm/r/cosmosdb_sql_container.html
seems to not be rendering on the index though.

@ghost
Copy link

ghost commented Sep 18, 2019

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 and limited conversation to collaborators Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants