-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_cosmosdb_account - support the Serverless
value for the capabilities
property
#8533
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @creotiv, this change looks good but a test needs to be added and documentation needs to be updated before we can merge it in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -203,6 +203,7 @@ func resourceArmCosmosDbAccount() *schema.Resource { | |||
"EnableCassandra", | |||
"EnableGremlin", | |||
"EnableTable", | |||
"Serverless", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
running the test for this we're getting:
Error: Error creating CosmosDB Account "acctest-ca-200921081838097854" (Resource Group "acctestRG-cosmos-200921081838097854"): Error creating/updating CosmosDB Account "acctest-ca-200921081838097854" (Resource Group "acctestRG-cosmos-200921081838097854"): documentdb.DatabaseAccountsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="Invalid capability Serverless.\r\nActivityId: 5dfe90e2-a83c-4a61-af17-3422cdd0de68, Microsoft.Azure.Documents.Common/2.11.0"
Provisioning one of these in the Azure Portal and then generating the ARM Template here gives us:
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string"
},
"location": {
"type": "string"
},
"locationName": {
"type": "string"
},
"defaultExperience": {
"type": "string"
},
"isZoneRedundant": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"apiVersion": "2020-04-01",
"kind": "GlobalDocumentDB",
"type": "Microsoft.DocumentDb/databaseAccounts",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"properties": {
"databaseAccountOfferType": "Standard",
"locations": [
{
"id": "[concat(parameters('name'), '-', parameters('location'))]",
"failoverPriority": 0,
"locationName": "[parameters('locationName')]"
}
],
"backupPolicy": {
"type": "Periodic",
"periodicModeProperties": {
"backupIntervalInMinutes": 240,
"backupRetentionIntervalInHours": 8
}
},
"isVirtualNetworkFilterEnabled": false,
"virtualNetworkRules": [],
"ipRules": [],
"dependsOn": [],
"capabilities": [
{
"name": "EnableServerless"
}
],
"enableFreeTier": false
},
"tags": {
"defaultExperience": "[parameters('defaultExperience')]",
"hidden-cosmos-mmspecial": "",
"CosmosAccountType": "Non-Production"
}
}
],
"outputs": {}
}
With the variables:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"value": "testtttttttttt"
},
"location": {
"value": "westus"
},
"locationName": {
"value": "West US"
},
"defaultExperience": {
"value": "Core (SQL)"
},
"isZoneRedundant": {
"value": "false"
}
}
}
Since we're using that API version, perhaps this also needs the tags set to be able to provision this?
It's worth noting in the preview documentation that Microsoft says at this time this is only available via the Azure Portal, so there could be some behind-the-scenes magic here too:
During the preview release, the only supported way to create a new serverless account is by using the Azure portal. Migrating existing accounts to/from serverless mode is not currently supported.
Serverless
value for the capabilities
property
This has been released in version 2.29.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 = "~> 2.29.0"
}
# ... other configuration ... |
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! |
No description provided.