-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
resource-explorer.tf
65 lines (52 loc) 路 1.14 KB
/
resource-explorer.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
locals {
resource_explorer_views = (var.resource_explorer.enabled
? var.resource_explorer.views
: []
)
}
###################################################
# Resource Explorer
###################################################
resource "aws_resourceexplorer2_index" "this" {
count = var.resource_explorer.enabled ? 1 : 0
type = var.resource_explorer.index_type
tags = merge(
{
"Name" = local.metadata.name
},
local.module_tags,
var.tags,
)
}
resource "aws_resourceexplorer2_view" "this" {
for_each = {
for view in local.resource_explorer_views :
view.name => view
}
name = each.key
default_view = each.value.is_default
dynamic "filters" {
for_each = each.value.filter_queries
iterator = query
content {
filter_string = query.value
}
}
dynamic "included_property" {
for_each = each.value.additional_resource_attributes
iterator = attribute
content {
name = attribute.value
}
}
tags = merge(
{
"Name" = each.key
},
local.module_tags,
var.tags,
)
depends_on = [
aws_resourceexplorer2_index.this,
]
}