Skip to content

Commit

Permalink
Merge pull request #3270 from phires/master
Browse files Browse the repository at this point in the history
Added Java 11 to App Service resource
  • Loading branch information
tombuildsstuff authored Apr 17, 2019
2 parents 3659045 + 034fb2f commit b0ed2fa
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 2 deletions.
1 change: 1 addition & 0 deletions azurerm/helpers/azure/app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func SchemaAppServiceSiteConfig() *schema.Schema {
ValidateFunc: validation.StringInSlice([]string{
"1.7",
"1.8",
"11",
}, false),
},

Expand Down
46 changes: 46 additions & 0 deletions azurerm/resource_arm_app_service_slot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,29 @@ func TestAccAzureRMAppServiceSlot_windowsJava8Jetty(t *testing.T) {
},
})
}
func TestAccAzureRMAppServiceSlot_windowsJava11Jetty(t *testing.T) {
resourceName := "azurerm_app_service_slot.test"
ri := tf.AccRandTimeInt()
config := testAccAzureRMAppServiceSlot_windowsJava(ri, testLocation(), "11", "JETTY", "9.3")

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMAppServiceSlotDestroy,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceSlotExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_version", "11"),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_container", "JETTY"),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_container_version", "9.3"),
),
},
},
})
}

func TestAccAzureRMAppServiceSlot_windowsJava7Tomcat(t *testing.T) {
resourceName := "azurerm_app_service_slot.test"
ri := tf.AccRandTimeInt()
Expand Down Expand Up @@ -762,6 +785,29 @@ func TestAccAzureRMAppServiceSlot_windowsJava8Tomcat(t *testing.T) {
})
}

func TestAccAzureRMAppServiceSlot_windowsJava11Tomcat(t *testing.T) {
resourceName := "azurerm_app_service_slot.test"
ri := tf.AccRandTimeInt()
config := testAccAzureRMAppServiceSlot_windowsJava(ri, testLocation(), "11", "TOMCAT", "9.0")

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMAppServiceSlotDestroy,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceSlotExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_version", "11"),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_container", "TOMCAT"),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_container_version", "9.0"),
),
},
},
})
}

func TestAccAzureRMAppServiceSlot_windowsPHP7(t *testing.T) {
resourceName := "azurerm_app_service_slot.test"
ri := tf.AccRandTimeInt()
Expand Down
54 changes: 54 additions & 0 deletions azurerm/resource_arm_app_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,33 @@ func TestAccAzureRMAppService_windowsJava8Jetty(t *testing.T) {
},
})
}
func TestAccAzureRMAppService_windowsJava11Jetty(t *testing.T) {
resourceName := "azurerm_app_service.test"
ri := tf.AccRandTimeInt()
config := testAccAzureRMAppService_windowsJava(ri, testLocation(), "11", "JETTY", "9.3")

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMAppServiceDestroy,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_version", "11"),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_container", "JETTY"),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_container_version", "9.3"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}
func TestAccAzureRMAppService_windowsJava7Tomcat(t *testing.T) {
resourceName := "azurerm_app_service.test"
ri := tf.AccRandTimeInt()
Expand Down Expand Up @@ -1014,6 +1041,33 @@ func TestAccAzureRMAppService_windowsJava8Tomcat(t *testing.T) {
},
})
}
func TestAccAzureRMAppService_windowsJava11Tomcat(t *testing.T) {
resourceName := "azurerm_app_service.test"
ri := tf.AccRandTimeInt()
config := testAccAzureRMAppService_windowsJava(ri, testLocation(), "11", "TOMCAT", "9.0")

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testCheckAzureRMAppServiceDestroy,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
testCheckAzureRMAppServiceExists(resourceName),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_version", "11"),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_container", "TOMCAT"),
resource.TestCheckResourceAttr(resourceName, "site_config.0.java_container_version", "9.0"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestAccAzureRMAppService_windowsPHP7(t *testing.T) {
resourceName := "azurerm_app_service.test"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/app_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ A `site_config` block supports the following:

* `ip_restriction` - (Optional) One or more `ip_restriction` blocks as defined below.

* `java_version` - (Optional) The version of Java to use. If specified `java_container` and `java_container_version` must also be specified. Possible values are `1.7` and `1.8`.
* `java_version` - (Optional) The version of Java to use. If specified `java_container` and `java_container_version` must also be specified. Possible values are `1.7`, `1.8` and `11`.

* `java_container` - (Optional) The Java Container to use. If specified `java_version` and `java_container_version` must also be specified. Possible values are `JETTY` and `TOMCAT`.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/app_service_slot.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ The following arguments are supported:

* `java_container_version` - (Optional) The version of the Java Container to use. If specified `java_version` and `java_container` must also be specified.

* `java_version` - (Optional) The version of Java to use. If specified `java_container` and `java_container_version` must also be specified. Possible values are `1.7` and `1.8`.
* `java_version` - (Optional) The version of Java to use. If specified `java_container` and `java_container_version` must also be specified. Possible values are `1.7`, `1.8` and `11`.

* `local_mysql_enabled` - (Optional) Is "MySQL In App" Enabled? This runs a local MySQL instance with your app and shares resources from the App Service plan.

Expand Down

0 comments on commit b0ed2fa

Please sign in to comment.