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 Free Tier on CosmosDB #6030

Closed
michaelmcneilnet opened this issue Mar 8, 2020 · 11 comments
Closed

Support for Free Tier on CosmosDB #6030

michaelmcneilnet opened this issue Mar 8, 2020 · 11 comments

Comments

@michaelmcneilnet
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

CosmosDb now offers a free tier, where they give 400 RU/s and 5 GB of storage for free in an account. You can enable free tier on up to one account per subscription. Is it possible to support this? I am using Pulumi and raised the issue there pulumi/pulumi-azure#480 and was told to raise it here.

I've added the Azure ARM template below as reference to the enableFreeTier property:

{
    "$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": "2019-12-12",
            "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')]"
                    }
                ],
                "enableMultipleWriteLocations": false,
                "isVirtualNetworkFilterEnabled": false,
                "virtualNetworkRules": [],
                "ipRangeFilter": "",
                "dependsOn": [],
                "capabilities": [],
                "enableFreeTier": true
            },
            "tags": {
                "defaultExperience": "[parameters('defaultExperience')]",
                "hidden-cosmos-mmspecial": "",
                "CosmosAccountType": "Non-Production"
            }
        }
    ],
    "outputs": {}
}

New or Affected Resource(s)

  • azurerm_cosmosdb
@mustodomenico

This comment has been minimized.

@stack72
Copy link
Contributor

stack72 commented May 25, 2020

@tombuildsstuff / @katbyte I am happy to submit a PR for this BUT it looks like the version of the cosmosdb SDK that the terraform provider is using will need updated to get access to this new property

Are you happy for me to upgrade this?

@tombuildsstuff
Copy link
Contributor

Dependent on #6253

@prabhakarreddy1234

This comment has been minimized.

@epomatti
Copy link

Are there any workarounds, other than creating it manually using the Portal?

Azure CLI is also dependent on the SDK #13535

@StefanSchoof
Copy link
Contributor

@evandropomatti I think it is possible to create this with an arm template. If you export a free tier in the portal the settings are there.

@phillebaba
Copy link
Contributor

I had a quick look at the code to see what needs to change to get this parameter into the resource.

Looking at the Azure Golang SDK the free tier boolean is set here in the DatabaseAccountCreateUpdateProperties which is then passed on to a DatabaseAccountCreateUpdateParameters.
https://github.com/Azure/azure-sdk-for-go/blob/6095b427503b02f76316e8c6c2c5316854cbef52/services/cosmos-db/mgmt/2020-04-01/documentdb/models.go#L1334

The DatabaseAccountCreateUpdateParameters are set here in the provider, which contains a DatabaseAccountCreateUpdateProperties.
https://github.com/terraform-providers/terraform-provider-azurerm/blob/5e66b05b25c3d78a55d14ccbd544a58f089776b3/azurerm/internal/services/cosmos/cosmosdb_account_resource.go#L325

The problem is that the Azure provider uses an old version of the documentdb service, which does not include the specific property.
https://github.com/terraform-providers/terraform-provider-azurerm/blob/5e66b05b25c3d78a55d14ccbd544a58f089776b3/azurerm/internal/services/cosmos/cosmosdb_account_resource.go#L13

We would need to update the version to the latest 2020-04-01 to be able to the the property. The question is if this will have any implications for existing resources, or if there are any breaking changes that would occur. I can give it a try later when I have some time, but it would be nice if any of the maintainers has any input on this.

@sdebruyn
Copy link
Contributor

Depends on #7597

@sdebruyn
Copy link
Contributor

Can be closed now

@katbyte katbyte closed this as completed Jul 27, 2020
@ghost
Copy link

ghost commented Jul 31, 2020

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

@ghost
Copy link

ghost commented Aug 26, 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 Aug 26, 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