Skip to content

intel/terraform-intel-azure-app-service-linux

Intel Logo

Intel Optimized Cloud Modules for Terraform

© Copyright 2024, Intel Corporation

Intel Optimized Cloud Module - Azure App Service Linux Web App

Module usage for creating an Azure App Service Linux Web App

Usage

See examples folder for complete examples.

By default, for the Linux 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

module "intel-optimized-service-plan" {
  source              = "intel/azure-app-service-plan/intel"
  service_plan_name   = "intel-linux-service-plan-02"
  resource_group_name = "terraform-testing-rg"
  }
}

module "linux-app-service" {
  source              = "intel/azure-app-service-linux/intel"
  app_name            = "intel-linux-app-service-02"
  resource_group_name = "terraform-testing-rg"
  service_plan_id     = module.intel-optimized-service-plan.id
  #Site_config is required 
  settings = {
    site_config = {
      application_stack = {
        node_version = "18-lts"
      }
    }
  }
}

Run Terraform

terraform init  
terraform plan
terraform apply 

Considerations

settings site_config is required https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_web_app#:~:text=An%20application_stack%20block%20supports%20the%20following%3A

Requirements

Name Version
terraform >=1.3.0
azurerm ~>3.86

Providers

Name Version
azurerm ~>3.86

Modules

No modules.

Resources

Name Type
azurerm_linux_web_app.web_app resource
azurerm_resource_group.rg data source

Inputs

Name Description Type Default Required
app_name The name of the Linux 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 clients to authenticate with a Certificate? bool false no
client_certificate_exclusion_paths The Client Certificate Exclusion Paths separated by ; (semicolon). string "" no
client_certificate_mode The Client Certificate Mode, can be Optional or Required. string "Optional" no
connection_strings Connection strings for App Service list(map(string)) [] no
enabled Is the Linux Web App Service enabled? bool true no
https_only Should the Linux Web App Service only be accessible via HTTPS only? bool true no
identity_ids Specifies a list of user managed identity ids list(string) [] no
identity_type The Managed Service Identity. Possible values are SystemAssigned, UserAssigned, and 'SystemAssigned, UserAssigned' (to enable both) string "" no
key_vault_reference_identity The Managed Service Identity ID which should be used to access Key Vault. string "" no
resource_group_name The name of the Resource Group in which to create the Linux Web App Service. string n/a yes
service_plan_id The ID of the App Service Plan within which to create this Linux Web App Service. string n/a yes
settings Variable used to pass in a list of settings to be used in the Linux Web App Service. any {} no
storage_key_vault_secret_id The secret ID for the connection string of the storage account used by the function app string "" no
storage_uses_managed_identity If you want the storage account to use a managed identity instead of a access key bool false no
tags A mapping of tags to assign to the resource. map(string) {} no
virtual_network_subnet_id The subnet id which will be used by this Web App for regional virtual network integration. string null no

Outputs

Name Description
app_settings A map of the Linux App Service's application settings
custom_domain_verification_id The ID of the custom domain verification
default_hostname The default hostname of the Linux App Service
id The ID of the Linux App Service
identity The identity of the Linux App Service
kind The kind of the Linux App Service
location The location of the Linux App Service
name The name of the Linux App Service
outbound_ip_address_list The outbound IP address list of the Linux App Service
outbound_ip_addresses The outbound IP addresses of the Linux App Service
possible_outbound_ip_address_list The possible outbound IP address list of the Linux App Service
possible_outbound_ip_addresses The possible outbound IP addresses of the Linux App Service
resource_group_name The name of the resource group in which the Linux App Service is created
service_plan_id The ID of the App Service Plan
site_credential The site credential of the Linux App Service
tags A map of the Linux App Service's tags

About

Intel Cloud Optimization Module - Azure App Service Linux Web App

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages