Skip to content

Commit 3b45e13

Browse files
committed
SEC-543 add Cloudwatch logging
1 parent aabf84b commit 3b45e13

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

cloudtrail.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module "cloudtrail" {
1212
name = var.cloudtrail_name
1313
enable_log_file_validation = var.cloudtrail_enable_log_file_validation
1414
enable_logging = var.cloudtrail_enable_logging
15+
cloud_watch_logs = var.cloudtrail_enable_cloudwatch_logs
1516
include_global_service_events = var.cloudtrail_include_global_service_events
1617
insight_selector = var.cloudtrail_insight_selector
1718
is_multi_region_trail = var.cloudtrail_is_multi_region_trail

modules/cloudtrail/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626
#tfsec:ignore:aws-cloudtrail-enable-at-rest-encryption
2727
module "cloudtrail" {
2828
#ts:skip=AC_AWS_0448 Multi Region is enabled. Not work with Org?
29-
#source = "appzen-oss/cloudtrail/aws"
30-
source = "../../../terraform-aws-cloudtrail"
29+
source = "appzen-oss/cloudtrail/aws"
30+
#source = "../../../terraform-aws-cloudtrail"
3131
#version = "0.22.0"
3232

3333
name = var.name
3434
enable_log_file_validation = var.enable_log_file_validation
35+
cloud_watch_logs = var.cloud_watch_logs
3536
include_global_service_events = var.include_global_service_events
3637
is_multi_region_trail = var.is_multi_region_trail
3738
is_organization_trail = var.is_organization_trail

modules/cloudtrail/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ variable "enable_logging" {
1111
default = true
1212
}
1313

14+
variable "cloud_watch_logs" {
15+
description = "Enable cloudwatch logging for the trail"
16+
type = bool
17+
default = true
18+
}
19+
1420
variable "include_global_service_events" {
1521
description = "Specifies whether the trail is publishing events from global services such as IAM to the log files"
1622
type = bool

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ variable "cloudtrail_enable_logging" {
327327
default = true
328328
}
329329

330+
variable "cloudtrail_enable_cloudwatch_logs" {
331+
description = "Enable logging for the trail"
332+
type = bool
333+
default = true
334+
}
335+
330336
variable "cloudtrail_include_global_service_events" {
331337
description = "Specifies whether the trail is publishing events from global services such as IAM to the log files"
332338
type = bool

0 commit comments

Comments
 (0)