forked from cmdlabs/terraform-aws-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecorder.tf
29 lines (26 loc) · 956 Bytes
/
recorder.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
locals {
config_name = "Config"
}
resource "aws_config_configuration_recorder" "config" {
name = local.config_name
recording_group {
all_supported = var.resource_types != null ? false : true
include_global_resource_types = var.resource_types != null ? false : var.include_global_resource_types
resource_types = var.resource_types
}
role_arn = aws_iam_role.config_role.arn
}
resource "aws_config_delivery_channel" "config" {
name = local.config_name
s3_bucket_name = var.bucket_name
snapshot_delivery_properties {
delivery_frequency = var.delivery_frequency
}
sns_topic_arn = aws_sns_topic.config.arn
depends_on = [aws_config_configuration_recorder.config]
}
resource "aws_config_configuration_recorder_status" "config" {
is_enabled = var.enable_recorder
name = aws_config_configuration_recorder.config.name
depends_on = [aws_config_delivery_channel.config]
}