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

Got Error which is inconsistent with documentation in autoscale setting configuration #3328

Closed
IMG-PRCSNG opened this issue Apr 29, 2019 · 3 comments · Fixed by #7480
Closed

Comments

@IMG-PRCSNG
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

Terraform (and AzureRM Provider) Version

Terraform = 0.11.3
AzureRM Provider = 1.24.0

Affected Resource(s)

  • azurerm_monitor_autoscale_settings

Terraform Configuration Files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key: https://keybase.io/hashicorp

data "azurerm_resource_group" "rg" {
  name = "${local.rg["name"]}"
}

resource "azurerm_monitor_autoscale_setting" "vmss" {
  name = "${local.prefix}-vmss-autoscale"
  resource_group_name = "${data.azurerm_resource_group.rg.name}"
  location = "${data.azurerm_resource_group.rg.location}"
  target_resource_id = "SOMEID"
  enabled = "${var.autoscalegreen}"
  profile {
    capacity {
      default = 4
      maximum = 6
      minimum = 2
    }
    name = "Profile1"
    rule {
      metric_trigger {
        metric_name = "customMetrics/${local.prefix}-greenvmss_queue_length"
        metric_resource_id = "${local.appinsights_id}"
        operator = "GreaterThanOrEqual"
        statistic = "Average"
        time_aggregation = "Last"
        time_grain = "PT1M"
        time_window = "PT5M"
        threshold = 0.66
      }
      scale_action {
        cooldown = "PT14M"
        direction = "Increase"
        type = "ChangeCount"
        value = 1
      }
    }
    recurrence {
      timezone = "India Standard Time"
      days = "${local.list_of_days}"
      hours = [ 9 ]
      minutes = [ 0 ]
    }
  }
}

Expected Behavior

I expected no error to have happened with this configuration, given the right values to the variables.

Actual Behavior

Got this Error message
Error: azurerm_monitor_autoscale_setting.greenvmss: expected profile.0.rule.0.metric_trigger.0.time_aggregation to be one of [Average Count Maximum Minimum Total], got Last

Steps to Reproduce

  1. terraform apply

References

@IMG-PRCSNG
Copy link
Author

Please do check this section from this repo - The schema validation check doesn't allow Last as a valid option for the time_aggregation field.

This doesn't represent the latest code from the azure msrest spec - This PR which was merged on 20 Sep 2018, has the relevant sections which support the parameter.

@ghost
Copy link

ghost commented Jun 25, 2020

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

@ghost
Copy link

ghost commented Jul 25, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Jul 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants