azurerm_app_service_slot_custom_hostname_binding

Manages a Hostname Binding within an App Service Slot.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "some-resource-group"
  location = "West Europe"
}
resource "azurerm_app_service_plan" "example" {
  name                = "some-app-service-plan"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku {
    tier = "Standard"
    size = "S1"
  }
}
resource "azurerm_app_service" "example" {
  name                = "some-app-service"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  app_service_plan_id = azurerm_app_service_plan.example.id
}
resource "azurerm_app_service_slot" "example" {
  name                = "staging"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  app_service_name    = azurerm_app_service.example.name
  app_service_plan_id = azurerm_app_service_plan.example.id
}
resource "azurerm_app_service_slot_custom_hostname_binding" "example" {
  app_service_slot_id = azurerm_app_service_slot.example.id
  hostname            = "www.mywebsite.com"
}

Argument Reference

The following arguments are supported:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

App Service Custom Hostname Bindings can be imported using the resource id, e.g.

terraform import azurerm_app_service_slot_custom_hostname_binding.mywebsite /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/instance1/slots/staging/hostNameBindings/mywebsite.com