-
Notifications
You must be signed in to change notification settings - Fork 0
/
locals.tf
62 lines (59 loc) · 2.47 KB
/
locals.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
locals {
connection_name = coalesce(var.connection_name, var.api_type)
connection_display_name = coalesce(var.connection_display_name, var.connection_name, var.api_type)
template = {
azureblob : templatefile("${path.module}/templates/azureblob.tftpl", local.azureblob_template_parameters[var.azureblob_authentication_type])
sharepointonline : templatefile("${path.module}/templates/sharepointonline.tftpl", {})
office365 : templatefile("${path.module}/templates/office365.tftpl", {})
planner : templatefile("${path.module}/templates/planner.tftpl", {})
}
logic_app_parameters = {
(var.api_type) : {
connectionId = jsondecode(azurerm_resource_group_template_deployment.this.output_content).connectionId.value
connectionName = local.connection_name
id = jsondecode(azurerm_resource_group_template_deployment.this.output_content).managedApiId.value
connectionProperties = can(local.logic_app_parameters_properties[var.api_type]) ? local.logic_app_parameters_properties[var.api_type] : {}
}
}
logic_app_parameters_properties = {
azureblob : var.azureblob_authentication_type == "Logic Apps Managed Identity" ? {
authentication : {
type : "ManagedServiceIdentity"
}
} : {}
}
azureblob_template_parameters = {
"Logic Apps Managed Identity" : {
authentication_type = "managedIdentityAuth"
storage_account_name = null
storage_access_key = null
client_id = null
client_secret = null
tenant_id = null
}
"Access Key" : {
authentication_type = "keyBasedAuth"
storage_account_name = var.azureblob_storage_account_name
storage_access_key = var.azureblob_storage_account_access_key
client_id = null
client_secret = null
tenant_id = null
}
"Service Principal" : {
authentication_type = "servicePrincipalAuth"
storage_account_name = null
storage_access_key = null
client_id = var.auth_service_principal_client_id
client_secret = var.auth_service_principal_client_secret
tenant_id = var.auth_service_principal_tenant_id
}
"Microsoft Entra ID" : {
authentication_type = "tokenBasedAuth"
storage_account_name = null
storage_access_key = null
client_id = null
client_secret = null
tenant_id = null
}
}
}