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

Missing cosmosdb graph resource even though the azure cli is the same for mongodb #3692

Closed
thomasmillergb opened this issue Jun 18, 2019 · 5 comments

Comments

@thomasmillergb
Copy link

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

I am trying to create an azure comosdb graph db and collectio. Creating the account is fine as part of pr.

However there is nothing on the terraform docs for the db and collection creation([If there is i cannot see it].(https://www.terraform.io/docs/providers/azurerm/r/cosmosdb_mongo_collection.html#)) about how to actually create the database and graph itself. Even though the az-cli to create graph db and collection is the exact same for mongdb

I am wanting the following from az-cli to be integrated into terraform. (This is the exact same as mongodb)

az cosmosdb database create \
    --resource-group $resourceGroupName \
    --name $accountName \
    --db-name $databaseName

az cosmosdb collection create \
--collection-name $graphName \
--name $accountName \
--db-name $databaseName \
--resource-group $resourceGroupName \
--partition-key-path /mypartitionkey \
--throughput 1000

New or Affected Resource(s)

New Resource

  • azurerm_cosmosdb_databse (like mongodb)
  • azurerm_cosmosdb_collection (like mongodb)

Potential Terraform Configuration

The following should be nearly the same as Mongodb or Mongodb should be intergrated into a new resource which takes care of both graph and Mongodb

data "azurerm_cosmosdb_account" "example" {
  name                = "tfex-cosmosdb-account"
  resource_group_name = "tfex-cosmosdb-account-rg"
}

resource "azurerm_cosmosdb_database" "example" {
  name                = "tfex-cosmos-db"
  resource_group_name = "${data.azurerm_cosmosdb_account.example.resource_group_name}"
  account_name        = "${data.azurerm_cosmosdb_account.example.name}"
}

resource "azurerm_cosmosdb_collection" "example" {
  name = "my-new-graph"
  account-name = "${data.azurerm_cosmosdb_account.example.name}"
  db-name = "${azurerm_cosmosdb_database.example.name}"
  resource-group = "${data.azurerm_cosmosdb_account.example.resource_group_name}"
  partition-key-path = "mypartitionkey"
  throughput = "400"
}

References

Terraform Doc for Cosmos
AZ CLI

  • #0000
@SebRosander
Copy link
Contributor

Started with the database part. Test seems fine, have to do some documentation and await some feedback on the pull request. I'll try to take a look into the gremlin graph parts if I find some time when this one is finished.

katbyte pushed a commit that referenced this issue Dec 26, 2019
jackbatzner pushed a commit to jackbatzner/terraform-provider-azurerm that referenced this issue Dec 31, 2019
@SebRosander
Copy link
Contributor

I've started to look into azurerm_cosmosdb_gremlin_graph parts as well. Still a newbie in go and haven't worked with gremlin that much, so it may take some time. Bear with me.

@tombuildsstuff tombuildsstuff changed the title Missing cosmosdb graph resource even though the awscli is the same for mongodb Missing cosmosdb graph resource even though the azure cli is the same for mongodb Jan 2, 2020
katbyte pushed a commit that referenced this issue Jan 8, 2020
@katbyte katbyte added this to the v1.41.0 milestone Jan 8, 2020
@katbyte
Copy link
Collaborator

katbyte commented Jan 8, 2020

fixed by #5301

@katbyte katbyte closed this as completed Jan 8, 2020
@ghost
Copy link

ghost commented Jan 16, 2020

This has been released in version 1.41.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.41.0"
}
# ... other configuration ...

@ghost
Copy link

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

No branches or pull requests

3 participants