Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Omit capacity when creating basic plans
The new [Basic SKU][0] does not support any scaling, and it is an error to provide `Capacity` or `AutoScaleSettings`. The resource is implemented in such a way that it was not possible to call `DeploymentsCreateOrUpdateThenPoll` without one of these in the `ScalingProperties`, which is illegal for the Basic SKUs. Currently the backend has a hack to silently drop `ScalingProperties` for Basic SKUs, but this is a confusing user experience: - initial `terraform apply` submits a `PUT` with `"scalingProperties": {"capacity": 20}` - this validation error is currently suppressed and the server reports back `"scalingProperties": null` - next `terraform plan` detects a `capacity 0 -> 20` - applying that plan requests a `PATCH` with `"scalingProperties": {"capacity": 20}`, that fails with a `UnsupportedOnBasicPlan` error It gets more misleading if users specify a capacity explicity; `capacity = 500` or `auto_scale_profile` will apply successfully, but get silently ignored server-side. This patch checks for basic plans and omits the `scalingProperties` when the user hasn't changed from the default value. We already instruct users to ignore `capacity`, but the check is needed to prevent the implicit default value of 20 from getting into the `DeploymentsCreateOrUpdateThenPoll` request. [0]: https://docs.nginx.com/nginxaas/azure/billing/overview/#basic-plan
- Loading branch information