Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for config recording frequency #191

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ No modules.
| config\_logs\_prefix | The S3 prefix for AWS Config logs. | `string` | `"config"` | no |
| config\_max\_execution\_frequency | The maximum frequency with which AWS Config runs evaluations for a rule. | `string` | `"TwentyFour_Hours"` | no |
| config\_name | The name of the AWS Config instance. | `string` | `"aws-config"` | no |
| config\_recording\_frequency | Default recording frequency for the AWS Config | `string` | `"CONTINUOUS"` | no |
| config\_recording\_frequency\_overrides | Specific overrides of the recording frequency for the AWS Config | ```set(object({ description = optional(string, null) resource_types = list(string) recording_frequency = string }))``` | `[]` | no |
| config\_role\_permissions\_boundary | The ARN of the permissions boundary to apply to IAM roles created for AWS Config | `string` | `null` | no |
| config\_sns\_topic\_arn | An SNS topic to stream configuration changes and notifications to. | `string` | `null` | no |
| cw\_loggroup\_retention\_period | Retention period for cloudwatch logs in number of days | `number` | `3653` | no |
Expand Down
14 changes: 14 additions & 0 deletions config-service.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,18 @@ resource "aws_config_configuration_recorder" "main" {
include_global_resource_types = length(var.resource_types) == 0 ? var.include_global_resource_types : null
resource_types = length(var.resource_types) == 0 ? null : var.resource_types
}

recording_mode {
recording_frequency = var.config_recording_frequency

dynamic "recording_mode_override" {
for_each = var.config_recording_frequency_overrides

content {
description = recording_mode_override.value.description
resource_types = recording_mode_override.value.resource_types
recording_frequency = recording_mode_override.value.recording_frequency
}
}
}
}
16 changes: 16 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,22 @@ variable "config_name" {
default = "aws-config"
}

variable "config_recording_frequency" {
description = "Default recording frequency for the AWS Config"
type = string
default = "CONTINUOUS"
}

variable "config_recording_frequency_overrides" {
description = "Specific overrides of the recording frequency for the AWS Config"
type = set(object({
description = optional(string, null)
resource_types = list(string)
recording_frequency = string
}))
default = []
}

variable "config_role_permissions_boundary" {
description = "The ARN of the permissions boundary to apply to IAM roles created for AWS Config"
type = string
Expand Down
Loading