forked from OfficeDev/microsoft-teams-apps-icebreaker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
50 lines (44 loc) · 1.61 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
provider "azurerm" {
features {
}
}
data "azurerm_client_config" "current" {}
resource "azuread_application" "icebreaker" {
display_name = "${var.name}-${var.stage}-${var.suffix}"
owners = [data.azurerm_client_config.current.object_id]
sign_in_audience = "AzureADMultipleOrgs"
}
resource "azuread_application_password" "icebreaker" {
application_object_id = azuread_application.icebreaker.object_id
}
locals {
arm_parameters = {
botAppID = azuread_application.icebreaker.application_id
botAppPassword = azuread_application_password.icebreaker.value
appName = var.name
appDescription = var.description_long
DefaultCulture = var.defaultCulture
pairingWeekInterval = var.pairingWeekInterval
pairingDayOfWeek = var.pairingDayOfWeek
pairingHour = var.pairingHour
pairingTimeZone = var.pairingTimeZone
sku = var.sku
cosmosDbEnableFreeTier = var.cosmosDbEnableFreeTier
cosmosDbServerless = var.cosmosDbServerless
appIconUrl = var.icon_url
}
}
data "azurerm_resource_group" "icebreaker" {
name = "rg-${var.name}-${var.stage}-${var.suffix}"
}
resource "azurerm_resource_group_template_deployment" "icebreaker" {
name = "icebreaker-deployment"
deployment_mode = "Complete"
resource_group_name = data.azurerm_resource_group.icebreaker.name
template_content = file("./Deployment/azuredeploy.json")
parameters_content = jsonencode(
{ for parameter, value in local.arm_parameters : parameter => {
value = value
} }
)
}