-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
53 lines (43 loc) · 1.38 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.5.0"
}
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rg" {
name = var.rgname
location = var.rglocation
}
resource "azurerm_storage_account" "storage" {
name = var.storage
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_service_plan" "appserviceplan" {
name = var.appserviceplan
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
os_type = "Linux"
sku_name = "Y1"
}
resource "azurerm_linux_function_app" "function" {
name = var.function
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
service_plan_id = azurerm_service_plan.appserviceplan.id
storage_account_name = azurerm_storage_account.storage.name
site_config {}
}
resource "azurerm_linux_function_app_slot" "appslot" {
name = var.appslot
function_app_id = azurerm_linux_function_app.function.id
storage_account_name = azurerm_storage_account.storage.name
site_config {}
}