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_app_service_slot - adding http2_enabled #1205

Merged
merged 1 commit into from
May 7, 2018
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
6 changes: 6 additions & 0 deletions azurerm/resource_arm_app_service_slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ func resourceArmAppServiceSlot() *schema.Resource {
DiffSuppressFunc: ignoreCaseDiffSuppressFunc,
},

"http2_enabled": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},

"java_version": {
Type: schema.TypeString,
Optional: true,
Expand Down
60 changes: 60 additions & 0 deletions azurerm/resource_arm_app_service_slot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,27 @@ func TestAccAzureRMAppServiceSlot_httpsOnly(t *testing.T) {
})
}

func TestAccAzureRMAppServiceSlot_http2Enabled(t *testing.T) {
resourceName := "azurerm_app_service_slot.test"
ri := acctest.RandInt()
config := testAccAzureRMAppServiceSlot_http2Enabled(ri, testLocation())

resource.Test(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.http2_enabled", "true"),
),
},
},
})
}

func TestAccAzureRMAppServiceSlot_localMySql(t *testing.T) {
resourceName := "azurerm_app_service_slot.test"
ri := acctest.RandInt()
Expand Down Expand Up @@ -924,6 +945,45 @@ resource "azurerm_app_service_slot" "test" {
`, rInt, location, rInt, rInt, rInt)
}

func testAccAzureRMAppServiceSlot_http2Enabled(rInt int, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
location = "%s"
}

resource "azurerm_app_service_plan" "test" {
name = "acctestASP-%d"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"

sku {
tier = "Standard"
size = "S1"
}
}

resource "azurerm_app_service" "test" {
name = "acctestAS-%d"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
app_service_plan_id = "${azurerm_app_service_plan.test.id}"
}

resource "azurerm_app_service_slot" "test" {
name = "acctestASSlot-%d"
location = "${azurerm_resource_group.test.location}"
resource_group_name = "${azurerm_resource_group.test.name}"
app_service_plan_id = "${azurerm_app_service_plan.test.id}"
app_service_name = "${azurerm_app_service.test.name}"

site_config {
http2_enabled = true
}
}
`, rInt, location, rInt, rInt, rInt)
}

func testAccAzureRMAppServiceSlot_localMySql(rInt int, location string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
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 @@ -183,7 +183,7 @@ The following arguments are supported:
* `always_on` - (Optional) Should the app be loaded at all times? Defaults to `false`.
* `default_documents` - (Optional) The ordering of default documents to load, if an address isn't specified.
* `dotnet_framework_version` - (Optional) The version of the .net framework's CLR used in this App Service Slot. Possible values are `v2.0` (which will use the latest version of the .net framework for the .net CLR v2 - currently `.net 3.5`) and `v4.0` (which corresponds to the latest version of the .net CLR v4 - which at the time of writing is `.net 4.7.1`). [For more information on which .net CLR version to use based on the .net framework you're targetting - please see this table](https://en.wikipedia.org/wiki/.NET_Framework_version_history#Overview). Defaults to `v4.0`.

* `http2_enabled` - (Optional) Is HTTP2 Enabled on this App Service? Defaults to `false`.
* `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_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`.
* `java_container_version` - (Optional) The version of the Java Container to use. If specified `java_version` and `java_container` must also be specified.
Expand Down