Skip to content

feat: support native SSM expiration policies for runner token parameters - #5265

Draft
jvrplmlmn wants to merge 1 commit into
github-aws-runners:mainfrom
jvrplmlmn:jvrplmlmn/ssm-token-ttl-expiration-policy
Draft

feat: support native SSM expiration policies for runner token parameters#5265
jvrplmlmn wants to merge 1 commit into
github-aws-runners:mainfrom
jvrplmlmn:jvrplmlmn/ssm-token-ttl-expiration-policy

Conversation

@jvrplmlmn

Copy link
Copy Markdown

Description

Registration tokens and JIT configs written to SSM are orphaned when an instance fails to boot or is terminated before registering. The only cleanup today is the scheduled SSM housekeeper lambda, which cannot delete parameters younger than a day, so orphaned parameters (billed hourly when on the Advanced tier) can live for up to ~2 days.

The new opt-in ssm_token_ttl_seconds attaches a native SSM Expiration policy to the token / JIT config parameters so SSM deletes leftovers itself once the TTL passes. Parameter policies require the Advanced tier, which incurs additional cost per parameter, hence disabled by default. Expiration is enforced asynchronously by SSM and is a cleanup mechanism rather than a security boundary; the housekeeper lambda remains as a backstop.

Test Plan

Related Issues

Registration tokens and JIT configs written to SSM are orphaned when an
instance fails to boot or is terminated before registering. The only
cleanup today is the scheduled SSM housekeeper lambda, which cannot
delete parameters younger than a day, so orphaned parameters (billed
hourly when on the Advanced tier) can live for up to ~2 days.

The new opt-in `ssm_token_ttl_seconds` attaches a native SSM Expiration
policy to the token / JIT config parameters so SSM deletes leftovers
itself once the TTL passes. Parameter policies require the Advanced
tier, which incurs additional cost per parameter, hence disabled by
default. Expiration is enforced asynchronously by SSM and is a cleanup
mechanism rather than a security boundary; the housekeeper lambda
remains as a backstop.
@edersonbrilhante

edersonbrilhante commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Nice idea. Just a small note, I am working ro refactor the module to make easier to maintain and add new features.
I have some idea to nest some variables to organize. It is a bit hard to keep track the features. I don't mind adding this new variable, but I would propose to deprecate in following major version and move it to a nested ssm variable.

@Brend-Smits @npalm @guicaulada what do you think?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants