1
1
variable "name" {
2
2
description = " Name of the application"
3
3
type = string
4
+ default = " vulne-soldier-compliance-remediate"
4
5
}
5
6
6
7
variable "aws_region" {
7
8
description = " AWS region where the resources will be created"
8
9
type = string
10
+ default = " us-east-1"
9
11
}
10
12
11
13
variable "environment" {
12
14
description = " Name of the environment"
13
15
type = string
16
+ default = " dev"
14
17
}
15
18
16
19
variable "account_id" {
17
20
description = " AWS account ID"
18
21
type = string
22
+ validation {
23
+ condition = can (regex (" ^[0-9]{12}$" , var. account_id ))
24
+ error_message = " The account_id must be a 12-digit number."
25
+ }
19
26
}
20
27
21
28
variable "lambda_log_group" {
@@ -26,7 +33,10 @@ variable "lambda_log_group" {
26
33
variable "lambda_zip" {
27
34
description = " File location of the lambda zip file for remediation."
28
35
type = string
29
- default = null
36
+ validation {
37
+ condition = can (regex (" ^.+\\ .zip$" , var. lambda_zip ))
38
+ error_message = " The lambda_zip must be a path to a zip file."
39
+ }
30
40
}
31
41
32
42
variable "remediation_options" {
@@ -47,4 +57,12 @@ variable "remediation_options" {
47
57
vulnerability_severities = " CRITICAL, HIGH"
48
58
override_findings_for_target_instances_ids = null
49
59
}
60
+ validation {
61
+ condition = contains ([" NoReboot" , " RebootIfNeeded" ], var. remediation_options . reboot_option )
62
+ error_message = " The reboot_option must be either NoReboot or RebootIfNeeded."
63
+ }
64
+ validation {
65
+ condition = can (regex (" ^([A-Z]+, )*[A-Z]+$" , var. remediation_options . vulnerability_severities ))
66
+ error_message = " The vulnerability_severities must be a comma-separated list of severities in uppercase."
67
+ }
50
68
}
0 commit comments