-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
68 lines (57 loc) · 1.89 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
locals {
location = "uksouth"
prefix = "gitopsdemo"
}
terraform {
backend "azurerm" {
resource_group_name = "gitopsdemo-tfstates-rg"
storage_account_name = "gitopsdemostore"
container_name = "gitopsdemotfstates"
key = "gitopsdemo.tfstate"
}
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">=3.0.0"
}
}
}
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "main" {
name = "${local.prefix}-rg"
location = local.location
}
resource "azurerm_storage_account" "main" {
name = "${local.prefix}storageacct"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
account_tier = "Standard"
account_replication_type = "LRS"
}
resource "azurerm_application_insights" "main" {
name = "${local.prefix}-appinsights"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
application_type = "web"
}
resource "azurerm_service_plan" "main" {
name = "${local.prefix}-asp"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
os_type = "Linux"
sku_name = "Y1"
}
resource "azurerm_linux_function_app" "main" {
name = "${local.prefix}-function"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
service_plan_id = azurerm_service_plan.main.id
storage_account_name = azurerm_storage_account.main.name
storage_account_access_key = azurerm_storage_account.main.primary_access_key
site_config {}
app_settings = {
AppInsights_InstrumentationKey = azurerm_application_insights.main.instrumentation_key
}
}