-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
60 lines (59 loc) · 1.88 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
// TERRAMATE: GENERATED AUTOMATICALLY DO NOT EDIT
resource "google_cloud_tasks_queue_iam_binding" "binding" {
name = var.name
location = var.location
count = var.module_enabled && var.policy_bindings == null && var.authoritative ? 1 : 0
depends_on = [
var.module_depends_on,
]
members = [for m in var.members : try(var.computed_members_map[regex("^computed:(.*)", m)[0]], m)]
project = var.project
provider = google
role = var.role
}
resource "google_cloud_tasks_queue_iam_member" "member" {
name = var.name
location = var.location
depends_on = [
var.module_depends_on,
]
for_each = var.module_enabled && var.policy_bindings == null && var.authoritative == false ? var.members : [
]
member = try(var.computed_members_map[regex("^computed:(.*)", each.value)[0]], each.value)
project = var.project
provider = google
role = var.role
}
resource "google_cloud_tasks_queue_iam_policy" "policy" {
name = var.name
location = var.location
count = var.module_enabled && var.policy_bindings != null ? 1 : 0
depends_on = [
var.module_depends_on,
]
policy_data = try(data.google_iam_policy.policy[0].policy_data, null)
project = var.project
provider = google
}
data "google_iam_policy" "policy" {
count = var.module_enabled && var.policy_bindings != null ? 1 : 0
provider = google
dynamic "binding" {
for_each = var.policy_bindings
content {
members = [for m in binding.value.members : try(var.computed_members_map[regex("^computed:(.*)", m)[0]], m)]
role = binding.value.role
dynamic "condition" {
for_each = try([
binding.value.condition,
], [
])
content {
description = try(condition.value.description, null)
expression = condition.value.expression
title = condition.value.title
}
}
}
}
}