-
Notifications
You must be signed in to change notification settings - Fork 229
/
Copy pathmain.tf
50 lines (43 loc) · 1.5 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
variable "prefix" {
default = "day17"
type = string
}
resource "azurerm_resource_group" "rg" {
name = "${var.prefix}-rg"
location = "canadacentral"
}
resource "azurerm_app_service_plan" "asp" {
name = "${var.prefix}-asp"
location = "${azurerm_resource_group.rg.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "as" {
name = "${var.prefix}-webapp"
location = "${azurerm_resource_group.rg.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"
app_service_plan_id = "${azurerm_app_service_plan.asp.id}"
}
resource "azurerm_app_service_slot" "slot" {
name = "${var.prefix}-staging"
location = "${azurerm_resource_group.rg.location}"
resource_group_name = "${azurerm_resource_group.rg.name}"
app_service_plan_id = "${azurerm_app_service_plan.asp.id}"
app_service_name = "${azurerm_app_service.as.name}"
}
resource "azurerm_app_service_source_control" "scm" {
app_id = azurerm_app_service.as.id
repo_url = "https://github.com/piyushsachdeva/tf-sample-bg"
branch = "master"
}
resource "azurerm_app_service_source_control_slot" "scm1" {
slot_id = azurerm_app_service_slot.slot.id
repo_url = "https://github.com/piyushsachdeva/tf-sample-bg"
branch = "appServiceSlot_Working_DO_NOT_MERGE"
}
resource "azurerm_web_app_active_slot" "active" {
slot_id = azurerm_app_service_slot.slot.id
}