forked from aztfmod/terraform-azurerm-caf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logic_app.tf
146 lines (115 loc) · 7.11 KB
/
logic_app.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
##### azurerm_integration_service_environment
module "integration_service_environment" {
source = "./modules/logic_app/integration_service_environment"
for_each = local.logic_app.integration_service_environment
name = each.value.name
resource_group_name = local.resource_groups[each.value.resource_group_key].name
location = lookup(each.value, "region", null) == null ? local.resource_groups[each.value.resource_group_key].location : local.global_settings.regions[each.value.region]
sku_name = each.value.sku_name
access_endpoint_type = each.value.access_endpoint_type
virtual_network_subnet_ids = each.value.virtual_network_subnet_ids
global_settings = local.global_settings
base_tags = try(local.global_settings.inherit_tags, false) ? local.resource_groups[each.value.resource_group_key].tags : {}
tags = try(each.value.tags, null)
}
output "integration_service_environment" {
value = module.integration_service_environment
}
##### azurerm_logic_app_action_custom
module "logic_app_action_custom" {
source = "./modules/logic_app/action_custom"
for_each = local.logic_app.logic_app_action_custom
name = each.value.name
logic_app_id = try(each.value.lz_key, null) == null ? local.combined_objects_logic_app_workflow[local.client_config.landingzone_key][each.value.logic_app_workflow_key].id : local.combined_objects_logic_app_workflow[each.value.lz_key][each.value.logic_app_workflow_key].id
body = each.value.body
}
output "logic_app_action_custom" {
value = module.logic_app_action_custom
}
##### azurerm_logic_app_action_http
module "logic_app_action_http" {
source = "./modules/logic_app/action_http"
for_each = local.logic_app.logic_app_action_http
name = each.value.name
logic_app_id = try(each.value.lz_key, null) == null ? local.combined_objects_logic_app_workflow[local.client_config.landingzone_key][each.value.logic_app_workflow_key].id : local.combined_objects_logic_app_workflow[each.value.lz_key][each.value.logic_app_workflow_key].id
method = each.value.method
uri = each.value.uri
body = each.value.body
headers = each.value.headers
run_after = each.value.run_after
}
output "logic_app_action_http" {
value = module.logic_app_action_http
}
##### azurerm_logic_app_integration_account
module "logic_app_integration_account" {
source = "./modules/logic_app/integration_account"
for_each = local.logic_app.logic_app_integration_account
name = each.value.name
resource_group_name = local.resource_groups[each.value.resource_group_key].name
location = lookup(each.value, "region", null) == null ? local.resource_groups[each.value.resource_group_key].location : local.global_settings.regions[each.value.region]
sku_name = each.value.sku_name
global_settings = local.global_settings
base_tags = try(local.global_settings.inherit_tags, false) ? local.resource_groups[each.value.resource_group_key].tags : {}
tags = try(each.value.tags, null)
}
output "logic_app_integration_account" {
value = module.logic_app_integration_account
}
##### azurerm_logic_app_trigger_custom
module "logic_app_trigger_custom" {
source = "./modules/logic_app/trigger_custom"
for_each = local.logic_app.logic_app_trigger_custom
name = each.value.name
logic_app_id = try(each.value.lz_key, null) == null ? local.combined_objects_logic_app_workflow[local.client_config.landingzone_key][each.value.logic_app_workflow_key].id : local.combined_objects_logic_app_workflow[each.value.lz_key][each.value.logic_app_workflow_key].id
body = each.value.body
}
output "logic_app_trigger_custom" {
value = module.logic_app_trigger_custom
}
##### azurerm_logic_app_trigger_http_request
module "logic_app_trigger_http_request" {
source = "./modules/logic_app/trigger_http_request"
for_each = local.logic_app.logic_app_trigger_http_request
name = each.value.name
logic_app_id = try(each.value.lz_key, null) == null ? local.combined_objects_logic_app_workflow[local.client_config.landingzone_key][each.value.logic_app_workflow_key].id : local.combined_objects_logic_app_workflow[each.value.lz_key][each.value.logic_app_workflow_key].id
schema = each.value.schema
method = each.value.method
relative_path = each.value.relative_path
}
output "logic_app_trigger_http_request" {
value = module.logic_app_trigger_http_request
}
##### azurerm_logic_app_trigger_recurrence
module "logic_app_trigger_recurrence" {
source = "./modules/logic_app/trigger_recurrence"
for_each = local.logic_app.logic_app_trigger_recurrence
name = each.value.name
logic_app_id = try(each.value.lz_key, null) == null ? local.combined_objects_logic_app_workflow[local.client_config.landingzone_key][each.value.logic_app_workflow_key].id : local.combined_objects_logic_app_workflow[each.value.lz_key][each.value.logic_app_workflow_key].id
frequency = each.value.frequency
interval = each.value.interval
start_time = each.value.start_time
# time_zone = try(each.value.time_zone, null)
}
output "logic_app_trigger_recurrence" {
value = module.logic_app_trigger_recurrence
}
##### azurerm_logic_app_workflow
module "logic_app_workflow" {
source = "./modules/logic_app/workflow"
for_each = local.logic_app.logic_app_workflow
name = each.value.name
resource_group_name = local.resource_groups[each.value.resource_group_key].name
location = lookup(each.value, "region", null) == null ? local.resource_groups[each.value.resource_group_key].location : local.global_settings.regions[each.value.region]
integration_service_environment_id = try(each.value.integration_service_environment_key, null) != null ? try(each.value.lz_key, null) == null ? local.combined_objects_integration_service_environment[local.client_config.landingzone_key][each.value.integration_service_environment_key].id : local.combined_objects_integration_service_environment[each.value.lz_key][each.value.integration_service_environment_key].id : null
logic_app_integration_account_id = try(each.value.logic_app_integration_account_key, null) != null ? try(each.value.lz_key, null) == null ? local.combined_objects_logic_app_integration_account[local.client_config.landingzone_key][each.value.logic_app_integration_account_key].id : local.combined_objects_logic_app_integration_account[each.value.lz_key][each.value.logic_app_integration_account_key].id : null
workflow_schema = try(each.value.workflow_schema, null)
workflow_version = try(each.value.workflow_version, null)
parameters = try(each.value.parameters, null)
global_settings = local.global_settings
base_tags = try(local.global_settings.inherit_tags, false) ? local.resource_groups[each.value.resource_group_key].tags : {}
tags = try(each.value.tags, null)
}
output "logic_app_workflow" {
value = module.logic_app_workflow
}