Skip to content

Commit 4ad8040

Browse files
committed
Fix support for AMIs with parentheses in the name
Some AMIs, like the `AWS Deep Learning Base GPU AMI (Ubuntu 24.04)`, have parentheses in the name. Parentheses are not allowed in SSM tags, leading to an error. This commit strips the parentheses out of the name.
1 parent 61d5d28 commit 4ad8040

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/runners/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ resource "aws_ssm_parameter" "runner_ami_id" {
102102
tags = merge(
103103
local.tags,
104104
{
105-
"ghr:ami_name" = data.aws_ami.runner.name
105+
# Remove parentheses from AMI name to comply with SSM tag constraints
106+
"ghr:ami_name" = replace(data.aws_ami.runner.name, "/[()]/", "")
106107
},
107108
{
108109
"ghr:ami_creation_date" = data.aws_ami.runner.creation_date

0 commit comments

Comments
 (0)