Skip to content

intel/terraform-intel-azure-app-service-windows

Intel Logo

Intel® Optimized Cloud Modules for Terraform

© Copyright 2024, Intel Corporation

Intel Cloud Optimization Module - Azure App Service Windows Web App

Module usage for creating an Azure App Service Windows Web App

Usage

See examples folder for complete examples.

By default, for the Windows App Web you only have to pass four variables

app_name
resource_group_name
service_plan_id
settings = {
    site_config = {
      application_stack = {
        node_version = "18-lts"
      }
    }
}

An app service web app needs a App Service Plan, for that look at the Intel App Service Plan module.

main.tf

# Create App Service Plan
module "intel-optimized-service-plan" {
  source              = "intel/azure-app-service-plan/intel"
  version             = "~>1.0.0"
  service_plan_name   = "windows-service-plan-103"
  resource_group_name = "terraform-testing-rg"
  os_type             = "Windows"
}

# Create App Service
module "windows-app-service" {
  source              = "intel/azure-app-service-windows/intel"
  version             = "~>1.0.0"
  app_name            = "windows-app-service-103"
  resource_group_name = "terraform-testing-rg"
  service_plan_id     = module.intel-optimized-service-plan.id
  #Site_config is required. See docs at https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_web_app#site_config
  settings = {
    site_config = {
      application_stack = {
        node_version = "~18"
      }
    }
  }
}

Run Terraform

terraform init  
terraform plan
terraform apply 

Considerations

Settings.site_config is required, documentation link:

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/windows_web_app#site_config

Requirements

Name Version
terraform >=1.3.0
azurerm ~>3.86

Providers

Name Version
azurerm ~>3.86

Modules

No modules.

Resources

Name Type
azurerm_app_service_virtual_network_swift_connection.vnet_integration resource
azurerm_windows_web_app.web_app resource
azurerm_resource_group.rg data source

Inputs

Name Description Type Default Required
active_directory_auth_settings A active_directory_auth_settings block. any {} no
app_name The name of the Windows Web App Service. string n/a yes
app_settings A map of key/value pairs of App Settings. map(any) {} no
client_affinity_enabled Should the App Service send session affinity cookies, which route client requests in the same session to the same instance? bool false no
client_certificate_enabled Should the App Service require a client certificate to be present on incoming requests? bool false no
client_certificate_mode The client certificate mode. Possible values are Optional, Required, and Ignore. string "Optional" no
connection_strings A connection_string block, see examples folder for details on how to use it. list(map(string)) [] no
enabled Should the App Service be enabled? bool true no
https_only Should the App Service only allow HTTPS traffic? bool true no
identity_ids A list of User Assigned Managed Identity IDs to be assigned to this Windows Web App. list(string) [] no
identity_type The type of identity to use for the App Service. Possible values are SystemAssigned and UserAssigned. string "SystemAssigned" no
resource_group_name The name of the Resource Group in which to create the Windows Web App Service. string n/a yes
service_plan_id The ID of the App Service Plan within which to create this Windows Web App Service. string n/a yes
settings A block of settings which can be used for various features of the App Service, see examples folder for details on how to use it. any false no
tags A mapping of tags to assign to the resource. map(string) {} no
vnet_integration_subnet_id The ID of the Subnet within the Virtual Network to which the App Service should be integrated. string "" no
web_app_vnet_integration_enabled Should the App Service be integrated with a Virtual Network? bool false no
zip_deploy_file The local path and filename to the zip file to deploy to the App Service. string null no

Outputs

Name Description
outbound_ip_addresses The outbound IP addresses of the App Service.
possible_outbound_ip_addresses The possible outbound IP addresses of the App Service.
site_credentials The site credentials of the App Service.
web_app_id The ID of the App Service.
web_app_identity The identity of the App Service.
web_app_kind The kind of the App Service.
web_app_name The name of the App Service.
web_app_url The URL of the App Service.

About

Intel Cloud Optimization Module - Azure App Service Windows Web App

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages