terraform/ecc-azure-427-dep_powershell_funcapp/green/function_app.tf (45 lines of code) (raw):
resource "azurerm_service_plan" "this" {
name = "sp-${var.prefix}-green"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
os_type = "Linux"
sku_name = "B1"
tags = var.tags
}
resource "azurerm_storage_account" "this" {
name = "sa${var.prefix}green"
resource_group_name = azurerm_resource_group.this.name
location = azurerm_resource_group.this.location
account_tier = "Standard"
account_replication_type = "LRS"
allow_nested_items_to_be_public = false
tags = var.tags
}
resource "azurerm_linux_function_app" "this" {
name = "functions${var.prefix}linux-green"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
service_plan_id = azurerm_service_plan.this.id
storage_account_name = azurerm_storage_account.this.name
storage_account_access_key = azurerm_storage_account.this.primary_access_key
site_config {
application_stack {
powershell_core_version = 7.4
}
}
tags = var.tags
}
resource "azurerm_windows_function_app" "this" {
name = "functions${var.prefix}windows-green"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
service_plan_id = azurerm_service_plan.this.id
storage_account_name = azurerm_storage_account.this.name
storage_account_access_key = azurerm_storage_account.this.primary_access_key
site_config {
application_stack {
powershell_core_version = 7.4
}
}
tags = var.tags
}