Skip to content

Commit 12b0765

Browse files
committed
updating variable definitions for CKV_AWS_338; also missing end curly brace
1 parent 9f9a32b commit 12b0765

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

aws_sra_examples/terraform/solutions/security_hub/configuration/variables.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ variable "lambda_log_group_kms_key" {
129129
variable "lambda_log_group_retention" {
130130
description = "Specifies the number of days you want to retain log events"
131131
type = number
132-
default = 14
132+
default = 365
133+
validation {
134+
condition = var.lambda_log_group_retention >= 365
135+
error_message = "Cloudwatch log group retention must be at least 365 days to meet CKV_AWS338 best practice."
136+
}
133137
}
134138

135139
variable "lambda_log_level" {

aws_sra_examples/terraform/solutions/security_hub/variables.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ variable "cis_standard_version" {
3939
type = string
4040
default = "3.0.0"
4141
validation {
42-
condition = contains(["NONE", "1.2.0", "1.4.0", "3.0.0"], var.cis_standard_version) # Changed to var.cis_standard_version
42+
condition = contains(["NONE", "1.2.0", "1.4.0", "3.0.0"], var.cis_standard_version)
4343
error_message = "Valid values for cis_standard_version are NONE, 1.2.0, 1.4.0, or 3.0.0."
4444
}
45+
}
4546

4647
variable "compliance_frequency" {
4748
description = "Frequency to Check for Organizational Compliance (in days between 1 and 30, default is 7)"
@@ -158,7 +159,11 @@ variable "lambda_log_group_kms_key" {
158159
variable "lambda_log_group_retention" {
159160
description = "Specifies the number of days you want to retain log events"
160161
type = number
161-
default = 14
162+
default = 365
163+
validation {
164+
condition = var.lambda_log_group_retention >= 365
165+
error_message = "Cloudwatch log group retention must be at least 365 days to meet CKV_AWS_338 best practice."
166+
}
162167
}
163168

164169
variable "lambda_log_level" {

0 commit comments

Comments
 (0)