terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

maximum_elastic_worker_count not ignored when set to 1 on non elastic premium plans

Open sit-md opened this issue 9 months ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Community Note

  • Please vote on this issue by adding a :thumbsup: 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 and review the contribution guide to help.

Terraform Version

1.8.2

AzureRM Provider Version

3.101.0

Affected Resource(s)/Data Source(s)

azurerm_service_plan

Terraform Configuration Files

resource "azurerm_service_plan" "appServicePlan" {
  name                         = "SomeAppServicePlan"
  resource_group_name          = "MyResourceGroup"
  location                     = "West Europe"
  sku_name                     = "Y1"
  maximum_elastic_worker_count = 1
  os_type                      = "Windows"
}

Debug Output/Panic Output

Error: `maximum_elastic_worker_count` can only be specified with Elastic Premium Skus

Expected Behaviour

The maximum_elastic_worker_count is ignored if plan kind is not Elastic Premium and this value is set to 1 (which is the value on a consumption-based plan after applying the configuration).

Actual Behaviour

On consumption plans: Before applying the configuration, the value of maximum_elastic_worker_count needs to be 0 to be ignored. After applying the configuration, the value of maximum_elastic_worker_count needs to be 1 to be ignored.

Steps to Reproduce

terraform apply

Important Factoids

No response

References

No response

sit-md avatar May 08 '24 11:05 sit-md

Thanks @sit-md for raising this issue, are you trying set the maximum_elastic_worker_count for consumption plan? If this is the case, let me confirm the api behavior first? Please correct me if there is any misunderstanding.

xiaxyi avatar May 10 '24 08:05 xiaxyi

@xiaxyi Yes, that is correct. Some context for you: in our non-production environments we use consumption plans to keep the costs low. In the stage and production environments we use elastic premium plans to be able to take the load. Our configuration for this resource lives in a module to keep it as DRY as possible.

sit-md avatar May 13 '24 06:05 sit-md