Skip to content

Commit 4c3132c

Browse files
ScottGuymernpalm
authored andcommitted
Update SSM to use advanced tiering
Due to the size of the JIT config returned by github we muse use advanced SSM config
1 parent 9d1e25a commit 4c3132c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lambdas/functions/control-plane/src/scale-runners/scale-up.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,18 @@ async function createJitConfig(githubRunnerConfig: CreateGitHubRunnerConfig, ins
450450
metricGitHubAppRateLimit(runnerConfig.headers);
451451

452452
// store jit config in ssm parameter store
453+
// Must used advanced tier for SSM as encoded_jit_config can be > 4kb
453454
logger.debug('Runner JIT config for ephemeral runner generated.', {
454455
instance: instance,
455456
});
456-
await putParameter(`${githubRunnerConfig.ssmTokenPath}/${instance}`, runnerConfig.data.encoded_jit_config, true, {
457-
tags: [{ Key: 'InstanceId', Value: instance }],
458-
});
457+
await putParameter(
458+
`${githubRunnerConfig.ssmTokenPath}/${instance}`,
459+
runnerConfig.data.encoded_jit_config, true,
460+
{
461+
tags: [{ Key: 'InstanceId', Value: instance }],
462+
},
463+
"Advanced"
464+
);
459465
if (isDelay) {
460466
// Delay to prevent AWS ssm rate limits by being within the max throughput limit
461467
await delay(25);

lambdas/libs/aws-ssm-util/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export async function putParameter(
2222
parameter_value: string,
2323
secure: boolean,
2424
options: { tags?: Tag[] } = {},
25+
tier: "Advanced" | "Standard" = "Standard",
2526
): Promise<void> {
2627
const client = getTracedAWSV3Client(new SSMClient({ region: process.env.AWS_REGION }));
2728
await client.send(
@@ -30,6 +31,7 @@ export async function putParameter(
3031
Value: parameter_value,
3132
Type: secure ? 'SecureString' : 'String',
3233
Tags: options.tags,
34+
Tier: tier
3335
}),
3436
);
3537
}

0 commit comments

Comments
 (0)