pulumi-azure icon indicating copy to clipboard operation
pulumi-azure copied to clipboard

azure.operationalinsights.AnalyticsWorkspace error when dailyQuotaGb is not set

Open boillodmanuel opened this issue 4 years ago • 3 comments

Version: @pulumi/azure v3.32.0

If dailyQuotaGb is not set, we got the following error :

    error: azure:operationalinsights/analyticsWorkspace:AnalyticsWorkspace resource 'aw' has a problem: expected daily_quota_gb to be at least (0.000000), got -1.000000

Terraform supports it (but does not support to explictly set -1, so I opened an issue for that https://github.com/terraform-providers/terraform-provider-azurerm/issues/9732)

Code:

new azure.operationalinsights.AnalyticsWorkspace("aw", {
    name: "log-aw-xyz",
    resourceGroupName: "rg-aw",
    retentionInDays: 30,
    sku: "PerGB2018",
})

Terraform behaviour :

  • when a value is set, it should be > 0
  • when no value is set, it defaults to -1

A bit weird IMHO (it's why I open an issue)

boillodmanuel avatar Dec 07 '20 16:12 boillodmanuel

Related to #783 This issue (#784) is the root cause, and #783 is the issue I had after trying to downgrade to a previous version

boillodmanuel avatar Dec 07 '20 16:12 boillodmanuel

Just hit this as well. Looking in to it, should the terraform resource just not be specifying a default value of -1?

https://github.com/terraform-providers/terraform-provider-azurerm/blob/82b73af7a3319e3abb2bc1eb083be86941e9e9ab/azurerm/internal/services/loganalytics/log_analytics_workspace_resource.go#L99-L105

It seems silly to set a default value and then a validator function that says that value is invalid.

gpduck avatar Feb 03 '21 18:02 gpduck

Totally agree! I opened an issue for that, cf my first comment, but they closed it

boillodmanuel avatar Feb 03 '21 19:02 boillodmanuel