Repository navigation
Conversation
… 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>
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>
…onds Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Multi-runner v2 lanes accept
storage_provider.aws.ssm.ttl_seconds.tokens, but the value never reached the Lambdas: thestorage_providervariable type ofmodules/runner-confighad nottl_secondsattribute, 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.tokensadded to the variable type (optional, defaultnull), documented, and validated as a positive number like the stablessm_ttl_seconds.tokens. It is handed to the webhook orchestration provider asstorage_provider.aws.ssm.token_ttl_seconds.modules/orchestration-providers/webhook(and itsscale-runners/poolchildren):storage_provider.aws.ssm.token_ttl_seconds = optional(number, null)added to the contract.SSM_TOKEN_TTL_SECONDSonly when the TTL is not null, so the environment is unchanged when it is omitted. The webhook Lambda code already readsSSM_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.tokensadded to the variable type and passed to the controller asjitConfigTTLSeconds, only when set.lambdas/libs/compute-providers/aws/ec2/src/scale-set:jitConfigTTLSecondsis parsed as an optional positive number. When set,publishJitConfigurationuses the Advanced tier and attaches anExpirationpolicy, matchingputParameterinaws-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 runstoken_ttl_defaults_to_disabled,token_ttl_reaches_scale_up_and_pool, andrejects_non_positive_token_ttl.modules/multi-runner/tests/config-translation.tftest.hcl:non_empty_v2_map_is_authoritativenow asserts that the lane'sttl_seconds.tokens = 7200reaches 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-runner26/26,runner-config24/24,orchestration-providers/webhook/scale-runners3/3,orchestration-providers/webhook/pool5/5.terraform validatepasses formodules/compute-providers/aws/ec2.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 -recursiveclean. Generated README tables are left to theupdate-docsworkflow.Related Issues
Fixes #5602
Fixes #5604