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

azurerm_api_management - update sku_name validation to accept new Premium SKUs #17887

Merged
merged 1 commit into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func ApimSkuName() pluginsdk.SchemaValidateFunc {
return validation.StringMatch(
regexp.MustCompile(`^Consumption_0$|^Basic_(1|2)$|^Developer_1$|^Premium_([1-9]|10)$|^Standard_[1-4]$`),
regexp.MustCompile(`^Consumption_0$|^Basic_(1|2)$|^Developer_1$|^Premium_([1-9][0-9]{0,1})$|^Standard_[1-4]$`),
`This is not a valid Api Management sku name.`,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,20 @@ func TestApimSkuName(t *testing.T) {
valid: false,
},
{
name: "Premium_11",
input: "Premium_11",
name: "Premium_101",
input: "Premium_101",
valid: false,
},
{
name: "Premium_10",
input: "Premium_10",
valid: true,
},
{
name: "Premium_12",
input: "Premium_12",
valid: true,
},
{
name: "Premium_7",
input: "Premium_7",
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/api_management.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ The following arguments are supported:

* `sku_name` - (Required) `sku_name` is a string consisting of two parts separated by an underscore(\_). The first part is the `name`, valid values include: `Consumption`, `Developer`, `Basic`, `Standard` and `Premium`. The second part is the `capacity` (e.g. the number of deployed units of the `sku`), which must be a positive `integer` (e.g. `Developer_1`).

~> **NOTE:** Premium SKU's are limited to a default maximum of 12 (i.e. `Premium_12`), this can, however, be increased via support request.

---

* `additional_location` - (Optional) One or more `additional_location` blocks as defined below.
Expand Down