Skip to content

Commit

Permalink
azurerm_windows_function_app node version validation strings. (#15884)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops authored Mar 21, 2022
1 parent 7fc6cb3 commit 27441ca
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
6 changes: 4 additions & 2 deletions internal/services/appservice/helpers/function_app_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,7 @@ func linuxFunctionAppStackSchema() *pluginsdk.Schema {
ValidateFunc: validation.StringInSlice([]string{
"12",
"14",
"16", // preview LTS Support
}, false),
ExactlyOneOf: []string{
"site_config.0.application_stack.0.dotnet_version",
Expand Down Expand Up @@ -1284,8 +1285,9 @@ func windowsFunctionAppStackSchema() *pluginsdk.Schema {
Type: pluginsdk.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{
"12",
"14",
"~12",
"~14",
"~16",
}, false),
ExactlyOneOf: []string{
"site_config.0.application_stack.0.dotnet_version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ func TestAccLinuxFunctionApp_appStackNode(t *testing.T) {

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.appStackNode(data, SkuBasicPlan, "14"),
Config: r.appStackNode(data, SkuConsumptionPlan, "14"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp,linux"),
Expand All @@ -694,6 +694,14 @@ func TestAccLinuxFunctionApp_appStackNodeUpdate(t *testing.T) {
),
},
data.ImportStep(),
{
Config: r.appStackNode(data, SkuBasicPlan, "16"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp,linux"),
),
},
data.ImportStep(),
{
Config: r.appStackNode(data, SkuBasicPlan, "14"),
Check: acceptance.ComposeTestCheckFunc(
Expand Down
14 changes: 11 additions & 3 deletions internal/services/appservice/windows_function_app_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ func TestAccWindowsFunctionApp_appStackNode(t *testing.T) {

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.appStackNode(data, SkuBasicPlan, "14"),
Config: r.appStackNode(data, SkuConsumptionPlan, "~14"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp"),
Expand All @@ -689,15 +689,23 @@ func TestAccWindowsFunctionApp_appStackNodeUpdate(t *testing.T) {

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.appStackNode(data, SkuBasicPlan, "12"),
Config: r.appStackNode(data, SkuBasicPlan, "~12"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp"),
),
},
data.ImportStep(),
{
Config: r.appStackNode(data, SkuBasicPlan, "14"),
Config: r.appStackNode(data, SkuBasicPlan, "~16"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp"),
),
},
data.ImportStep(),
{
Config: r.appStackNode(data, SkuBasicPlan, "~14"),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
check.That(data.ResourceName).Key("kind").HasValue("functionapp"),
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/linux_function_app.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ A `application_stack` block supports the following:

* `java_version` - (Optional) The Version of Java to use. Supported versions include `8`, and `11`.

* `node_version` - (Optional) The version of Node to run. Possible values include `12`, and `14`.
* `node_version` - (Optional) The version of Node to run. Possible values include `12`, `14`, and `16`.

* `python_version` - (Optional) The version of Python to run. Possible values include `3.6`, `3.7`, `3.8`, and `3.9`.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/windows_function_app.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ A `application_stack` block supports the following:

* `java_version` - (Optional) The Version of Java to use. Supported versions include `8`, and `11`.

* `node_version` - (Optional) The version of Node to run. Possible values include `12`, and `14`.
* `node_version` - (Optional) The version of Node to run. Possible values include `~12`, `~14`, and `~16`.

* `powershell_core_version` - (Optional) The version of PowerShell Core to run. Possible values are `7`.

Expand Down

0 comments on commit 27441ca

Please sign in to comment.