Skip to content

Commit 6d3b7db

Browse files
authored
fix(logging): update log_class to log_group_class in CloudWatch agent configuration (#5073)
### Description CloudWatch agent config stored in SSM used log_class inside each collect_list entry. The agent’s JSON schema only allows log_group_class there, so validation failed with “Additional property log_class is not allowed” and runner user-data exited before the GitHub runner started ([issue #5065](#5065)). This PR maps the Terraform log_class value to log_group_class in the serialized logfiles blob passed to cloudwatch_config.json, and updates loggroups_classes to read log_group_class from local.logfiles so aws_cloudwatch_log_group behavior stays aligned. ## Related Issues Fixes [#5065](#5065)
1 parent e4b12ae commit 6d3b7db

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/runners/logging.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,20 @@ locals {
3333
}
3434
]
3535
)
36+
# CloudWatch agent collect_list schema expects log_group_class, not log_class
3637
logfiles = var.enable_cloudwatch_agent ? [for l in local.runner_log_files : {
3738
"log_group_name" : l.prefix_log_group ? "/github-self-hosted-runners/${var.prefix}/${l.log_group_name}" : "/${l.log_group_name}"
3839
"log_stream_name" : l.log_stream_name
3940
"file_path" : l.file_path
40-
"log_class" : l.log_class
41+
"log_group_class" : l.log_class
4142
}] : []
4243

4344
loggroups_names = distinct([for l in local.logfiles : l.log_group_name])
4445
# Create a list of unique log classes corresponding to each log group name
4546
# This maintains the same order as loggroups_names for use with count
4647
loggroups_classes = [
4748
for name in local.loggroups_names : [
48-
for l in local.logfiles : l.log_class
49+
for l in local.logfiles : l.log_group_class
4950
if l.log_group_name == name
5051
][0]
5152
]

0 commit comments

Comments
 (0)