-
-
Notifications
You must be signed in to change notification settings - Fork 81
/
Copy pathmain.tf
60 lines (55 loc) · 2.37 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
resource "aws_cloudtrail" "default" {
count = module.this.enabled ? 1 : 0
name = module.this.id
enable_logging = var.enable_logging
s3_bucket_name = var.s3_bucket_name
enable_log_file_validation = var.enable_log_file_validation
sns_topic_name = var.sns_topic_name
is_multi_region_trail = var.is_multi_region_trail
include_global_service_events = var.include_global_service_events
cloud_watch_logs_role_arn = var.cloud_watch_logs_role_arn
cloud_watch_logs_group_arn = var.cloud_watch_logs_group_arn
tags = module.this.tags
kms_key_id = var.kms_key_arn
is_organization_trail = var.is_organization_trail
s3_key_prefix = var.s3_key_prefix
dynamic "insight_selector" {
for_each = var.insight_selector
content {
insight_type = insight_selector.value.insight_type
}
}
dynamic "event_selector" {
for_each = var.event_selector
content {
include_management_events = lookup(event_selector.value, "include_management_events", null)
read_write_type = lookup(event_selector.value, "read_write_type", null)
exclude_management_event_sources = event_selector.value.exclude_management_event_sources
dynamic "data_resource" {
for_each = lookup(event_selector.value, "data_resource", [])
content {
type = data_resource.value.type
values = data_resource.value.values
}
}
}
}
dynamic "advanced_event_selector" {
for_each = var.advanced_event_selector
content {
name = lookup(advanced_event_selector.value, "name", null)
dynamic "field_selector" {
for_each = advanced_event_selector.value.field_selector
content {
field = field_selector.value.field
equals = lookup(field_selector.value, "equals", null)
not_equals = lookup(field_selector.value, "not_equals", null)
starts_with = lookup(field_selector.value, "starts_with", null)
not_starts_with = lookup(field_selector.value, "not_starts_with", null)
ends_with = lookup(field_selector.value, "ends_with", null)
not_ends_with = lookup(field_selector.value, "not_ends_with", null)
}
}
}
}
}