Skip to content

fix(multi-runner): honour v2 storage_provider token TTL for webhook and scale-set lanes - #5603

Open
wadherv wants to merge 3 commits into
github-aws-runners:mainfrom
wadherv:issue_5602
Open

wadherv wants to merge 3 commits into
github-aws-runners:mainfrom
wadherv:issue_5602

Conversation

@wadherv

@wadherv wadherv commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

Multi-runner v2 lanes accept storage_provider.aws.ssm.ttl_seconds.tokens, but the value never reached the Lambdas: the storage_provider variable type of modules/runner-config had no ttl_seconds attribute, so it was dropped by type conversion. As a result, token / JIT-config parameters of v2 lanes were created without an SSM expiration policy, for both webhook and scale-set lanes.

Webhook lanes (#5602)

The webhook orchestration provider's scale-up and pool functions never set SSM_TOKEN_TTL_SECONDS, so migrating a v1 lane to v2 removed it from both functions. This wires the TTL through the v2 path, matching v1 (modules/runners/scale-up.tf, modules/runners/pool/main.tf):

  • modules/runner-config: storage_provider.aws.ssm.ttl_seconds.tokens added to the variable type (optional, default null), documented, and validated as a positive number like the stable ssm_ttl_seconds.tokens. It is handed to the webhook orchestration provider as storage_provider.aws.ssm.token_ttl_seconds.
  • modules/orchestration-providers/webhook (and its scale-runners / pool children): storage_provider.aws.ssm.token_ttl_seconds = optional(number, null) added to the contract.
  • Scale-up and pool Lambdas set SSM_TOKEN_TTL_SECONDS only when the TTL is not null, so the environment is unchanged when it is omitted. The webhook Lambda code already reads SSM_TOKEN_TTL_SECONDS, so no Lambda changes are needed for these lanes.

Scale-set lanes (#5604)

The EC2 scale-set controller wrote each runner's JIT configuration to <root>/<tokens>/<instance-id> without an Expiration policy, and the TTL was never passed to it. Parameters for instances that never reached the start script (terminated before boot, spot interruption, scale-in before boot, stack destroyed) were left behind indefinitely.

  • modules/compute-providers/aws/ec2: storage_provider.aws.ssm.ttl_seconds.tokens added to the variable type and passed to the controller as jitConfigTTLSeconds, only when set.
  • lambdas/libs/compute-providers/aws/ec2/src/scale-set: jitConfigTTLSeconds is parsed as an optional positive number. When set, publishJitConfiguration uses the Advanced tier and attaches an Expiration policy, matching putParameter in aws-ssm-util. Behaviour is unchanged when it is omitted.

As with v1, the TTL is opt-in because Advanced-tier parameters incur additional costs.

Test Plan

  • modules/runner-config/tests/pool.tftest.hcl: new runs token_ttl_defaults_to_disabled, token_ttl_reaches_scale_up_and_pool, and rejects_non_positive_token_ttl.
  • modules/multi-runner/tests/config-translation.tftest.hcl: non_empty_v2_map_is_authoritative now asserts that the lane's ttl_seconds.tokens = 7200 reaches the scale-up Lambda environment end to end. Verified this assertion fails without the wiring change and passes with it.
  • terraform test (Terraform 1.15.8, mocked provider) passes in all affected modules: multi-runner 26/26, runner-config 24/24, orchestration-providers/webhook/scale-runners 3/3, orchestration-providers/webhook/pool 5/5.
  • terraform validate passes for modules/compute-providers/aws/ec2.
  • Scale-set unit tests (scale-up.test.ts, configuration.test.ts) cover the Standard tier without a policy when no TTL is set, the Advanced tier with the exact expiration timestamp when a TTL is set, and rejection of invalid TTL values (0, -1, NaN, '3600'). The scale-set suite passes 43/43; prettier and eslint are clean.
  • terraform fmt -recursive clean. Generated README tables are left to the update-docs workflow.

Related Issues

Fixes #5602
Fixes #5604

… pool

A multi-runner v2 lane accepted storage_provider.aws.ssm.ttl_seconds.tokens,
but runner-config's storage_provider type had no ttl_seconds attribute, so
the value was dropped and SSM_TOKEN_TTL_SECONDS never reached the scale-up
or pool Lambdas. Token parameters were created without an expiration
policy, and migrating a v1 lane to v2 removed the variable.

runner-config now accepts and validates ttl_seconds.tokens and hands it to
the webhook orchestration provider as storage_provider.aws.ssm.token_ttl_seconds.
The scale-up and pool Lambdas set SSM_TOKEN_TTL_SECONDS when it is not null,
matching modules/runners.

Fixes github-aws-runners#5602

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wadherv
wadherv requested review from a team as code owners November 21, 2026 07:02
Scale-set lanes stored each runner's JIT configuration in SSM without an
Expiration policy, so parameters for instances that never booted were
left behind indefinitely.

Pass storage_provider.aws.ssm.ttl_seconds.tokens to the EC2 scale-set
controller as jitConfigTtlSeconds. When set, publishJitConfiguration
uses the Advanced tier and attaches an Expiration policy, matching the
webhook lanes. Behaviour is unchanged when the TTL is omitted.

Fixes github-aws-runners#5604

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wadherv wadherv changed the title fix(multi-runner): pass v2 storage_provider token TTL to scale-up and pool fix(multi-runner): honour v2 storage_provider token TTL for webhook and scale-set lanes Nov 23, 2026
…onds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant