Skip to content

Commit 5cc5536

Browse files
authored
[Wiz Sensor] Fix typo in variable name (#6765)
Realized the variable name had accidentally left in the plural form instead of singular. This is a safe change to make right now since this variable doesn't actually have a value passed in to it yet
1 parent 58cddf2 commit 5cc5536

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

terraform-aws-github-runner/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ module "runners_instances" {
211211

212212
runner_iam_role_managed_policy_arns = var.runner_iam_role_managed_policy_arns
213213

214-
wiz_secrets_arn = var.wiz_secrets_arn
215-
wiz_secrets_kms_key_arn = var.wiz_secrets_kms_key_arn
214+
wiz_secret_arn = var.wiz_secret_arn
215+
wiz_secret_kms_key_arn = var.wiz_secret_kms_key_arn
216216

217217
ghes_url = var.ghes_url
218218
}

terraform-aws-github-runner/modules/runners-instances/launch-template.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ resource "aws_launch_template" "linux_runner" {
122122
nvidia_driver_install = false
123123
ssm_key_cloudwatch_agent_config = var.enable_cloudwatch_agent ? aws_ssm_parameter.cloudwatch_agent_config_runner_linux[0].name : ""
124124
ghes_url = var.ghes_url
125-
wiz_secrets_arn = var.wiz_secrets_arn
125+
wiz_secret_arn = var.wiz_secret_arn
126126
install_config_runner = local.install_config_runner_linux
127127
}))
128128

@@ -179,7 +179,7 @@ resource "aws_launch_template" "linux_runner_nvidia" {
179179
nvidia_driver_install = true
180180
ssm_key_cloudwatch_agent_config = var.enable_cloudwatch_agent ? aws_ssm_parameter.cloudwatch_agent_config_runner_linux[0].name : ""
181181
ghes_url = var.ghes_url
182-
wiz_secrets_arn = var.wiz_secrets_arn
182+
wiz_secret_arn = var.wiz_secret_arn
183183
install_config_runner = local.install_config_runner_linux
184184
}))
185185

@@ -236,7 +236,7 @@ resource "aws_launch_template" "linux_arm64_runner" {
236236
nvidia_driver_install = false
237237
ssm_key_cloudwatch_agent_config = var.enable_cloudwatch_agent ? aws_ssm_parameter.cloudwatch_agent_config_runner_linux_arm64[0].name : ""
238238
ghes_url = var.ghes_url
239-
wiz_secrets_arn = var.wiz_secrets_arn
239+
wiz_secret_arn = var.wiz_secret_arn
240240
install_config_runner = local.install_config_runner_linux_arm64
241241
}))
242242

terraform-aws-github-runner/modules/runners-instances/policies-runner.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ resource "aws_iam_role_policy" "create_tags" {
5454
policy = file("${path.module}/policies/instance-ec2-create-tags-policy.json")
5555
}
5656

57-
# This policy is conditionally created only when wiz_secrets_arn is provided.
57+
# This policy is conditionally created only when wiz_secret_arn is provided.
5858
# This ensures we don't create empty policies when no secret access is needed,
5959
# making the security configuration more explicit and reducing IAM clutter.
6060
resource "aws_iam_role_policy" "secrets_access" {
61-
count = var.wiz_secrets_arn != null ? 1 : 0
61+
count = var.wiz_secret_arn != null ? 1 : 0
6262
name = "runner-secrets-access"
6363
role = aws_iam_role.runner.name
6464

6565
lifecycle {
6666
precondition {
67-
condition = var.wiz_secrets_arn == null || var.wiz_secrets_kms_key_arn != null
68-
error_message = "wiz_secrets_kms_key_arn must be provided when wiz_secrets_arn is specified. The secret requires explicit KMS key permissions for decryption."
67+
condition = var.wiz_secret_arn == null || var.wiz_secret_kms_key_arn != null
68+
error_message = "wiz_secret_kms_key_arn must be provided when wiz_secret_arn is specified. The secret requires explicit KMS key permissions for decryption."
6969
}
7070
}
7171

@@ -76,9 +76,9 @@ resource "aws_iam_role_policy" "secrets_access" {
7676
# (e.g., "MySecret" becomes "MySecret-a1b2c3")
7777
# We use "-??????" to match the format exactly, which is more secure than "*"
7878
# This handles cases where users provide bare secret names or already-complete ARNs
79-
secrets_arn = endswith(var.wiz_secrets_arn, "*") || can(regex("-[a-zA-Z0-9]{6}$", var.wiz_secrets_arn)) ? var.wiz_secrets_arn : "${var.wiz_secrets_arn}-??????"
79+
secrets_arn = endswith(var.wiz_secret_arn, "*") || can(regex("-[a-zA-Z0-9]{6}$", var.wiz_secret_arn)) ? var.wiz_secret_arn : "${var.wiz_secret_arn}-??????"
8080
# KMS key ARN for decrypting the secret - must be provided when secret is specified
81-
kms_key_arn = var.wiz_secrets_kms_key_arn
81+
kms_key_arn = var.wiz_secret_kms_key_arn
8282
aws_region = var.aws_region
8383
}
8484
)

terraform-aws-github-runner/modules/runners-instances/templates/user-data.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ ${install_config_runner}
104104
retry sudo dnf groupinstall -y 'Development Tools'
105105
retry sudo dnf install -y "kernel-devel-uname-r == $(uname -r)" || true
106106

107-
%{ if wiz_secrets_arn != null ~}
107+
%{ if wiz_secret_arn != null ~}
108108
# Install Wiz Sensor - a runtime security agent
109109
echo "Fetching Wiz secrets from AWS Secrets Manager"
110110

@@ -125,12 +125,12 @@ echo "Fetching Wiz secrets from AWS Secrets Manager"
125125
fi
126126
}
127127

128-
SECRET_REGION=$(get_region_from_arn "${wiz_secrets_arn}")
128+
SECRET_REGION=$(get_region_from_arn "${wiz_secret_arn}")
129129
if [ -z "$SECRET_REGION" ]; then
130130
echo "Warning: Region is required in the Secrets Manager ARN. Skipping Wiz installation."
131131
metric_report "linux_userdata.wiz_failure_arn_invalid" 1
132132
else
133-
WIZ_SECRET_RAW=$(retry aws secretsmanager get-secret-value --secret-id "${wiz_secrets_arn}" --region "$SECRET_REGION" --query 'SecretString' --output text)
133+
WIZ_SECRET_RAW=$(retry aws secretsmanager get-secret-value --secret-id "${wiz_secret_arn}" --region "$SECRET_REGION" --query 'SecretString' --output text)
134134
if [ $? -eq 0 ] && [ ! -z "$WIZ_SECRET_RAW" ]; then
135135
echo "Successfully retrieved Wiz secrets"
136136
echo "Extracting Wiz runtime sensor credentials"
@@ -151,7 +151,7 @@ echo "Fetching Wiz secrets from AWS Secrets Manager"
151151
metric_report "linux_userdata.wiz_failure_credentials_missing" 1
152152
fi
153153
else
154-
echo "Warning: Failed to retrieve Wiz secrets from ${wiz_secrets_arn}"
154+
echo "Warning: Failed to retrieve Wiz secrets from ${wiz_secret_arn}"
155155
metric_report "linux_userdata.wiz_failure_secrets_error" 1
156156
fi
157157
fi

terraform-aws-github-runner/modules/runners-instances/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,14 @@ variable "key_name" {
196196
default = null
197197
}
198198

199-
variable "wiz_secrets_arn" {
199+
variable "wiz_secret_arn" {
200200
description = "ARN of AWS Secrets Manager secret that the runner role should have access to"
201201
type = string
202202
sensitive = true
203203
}
204204

205-
variable "wiz_secrets_kms_key_arn" {
206-
description = "ARN of KMS key used to encrypt the secret specified in wiz_secrets_arn. Must be provided if wiz_secrets_arn is specified."
205+
variable "wiz_secret_kms_key_arn" {
206+
description = "ARN of KMS key used to encrypt the secret specified in wiz_secret_arn. Must be provided if wiz_secret_arn is specified."
207207
type = string
208208
sensitive = true
209209
}

terraform-aws-github-runner/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,15 @@ variable "retry_scale_up_chron_hud_query_url" {
374374
default = ""
375375
}
376376

377-
variable "wiz_secrets_arn" {
377+
variable "wiz_secret_arn" {
378378
description = "ARN of AWS Secrets Manager secret that the runner role should have access to"
379379
type = string
380380
default = null
381381
sensitive = true
382382
}
383383

384-
variable "wiz_secrets_kms_key_arn" {
385-
description = "ARN of KMS key used to encrypt the secret specified in wiz_secrets_arn. Must be provided if wiz_secrets_arn is specified."
384+
variable "wiz_secret_kms_key_arn" {
385+
description = "ARN of KMS key used to encrypt the secret specified in wiz_secret_arn. Must be provided if wiz_secret_arn is specified."
386386
type = string
387387
default = null
388388
sensitive = true

0 commit comments

Comments
 (0)