forked from trussworks/terraform-aws-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config-service.tf
38 lines (29 loc) · 962 Bytes
/
config-service.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
#
# AWS Config Service
#
resource "aws_config_configuration_recorder_status" "main" {
count = var.enable_config_recorder ? 1 : 0
name = var.config_name
is_enabled = true
depends_on = [aws_config_delivery_channel.main]
}
resource "aws_config_delivery_channel" "main" {
count = var.enable_config_recorder ? 1 : 0
name = var.config_name
s3_bucket_name = var.config_logs_bucket
s3_key_prefix = var.config_logs_prefix
sns_topic_arn = var.config_sns_topic_arn
snapshot_delivery_properties {
delivery_frequency = var.config_delivery_frequency
}
depends_on = [aws_config_configuration_recorder.main]
}
resource "aws_config_configuration_recorder" "main" {
count = var.enable_config_recorder ? 1 : 0
name = var.config_name
role_arn = aws_iam_role.main[count.index].arn
recording_group {
all_supported = true
include_global_resource_types = var.include_global_resource_types
}
}