feat(ec2): add tags option to Ec2RunnerProvider - #961
Merged
mergify[bot] merged 4 commits intoJul 28, 2026
Conversation
Allow static tags to be merged into RunInstances TagSpecifications so they exist from instance launch. Needed when security monitoring must enroll a host by tag before the runner job starts; job-started hooks are too late for short-lived ephemeral runners. Reserved Name and GitHubRunners:* keys remain owned by the provider. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
|
@kichik Thoughts on this approach for extending tags? This seemed like a better option rather than the fragile nature of the user data approach. |
Member
|
I've been resisting this for a long time. But I can't deny it's useful. Let me clean it up a tiny bit and merge. |
instanceTags -> tags allow overriding DRY tests keep readme shorter
Member
|
Thanks. |
tags option to Ec2RunnerProvider
kichik
approved these changes
Jul 28, 2026
Merge Queue Status
This pull request spent 31 seconds in the queue, including 7 seconds running CI. Required conditions to merge
|
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.
Summary
Adds an
tagsprop toEc2RunnerProviderthat merges extra tags into the existingRunInstancesTagSpecifications(instance + volume).Why launch-time tags (not job hooks): security monitoring that enrolls hosts by tag needs the tag present from the moment the instance exists. Tagging from
ACTIONS_RUNNER_HOOK_JOB_STARTED(the workaround from #524) runs only after the job starts, which is too late for short-lived ephemeral runners — the instance may terminate before the agent is installed.cdk.Tags.of()also does not help, because these instances are created dynamically by Step Functions, not as CloudFormation resources.This builds on the tags already applied in #909 (
Name,GitHubRunners:*) and makes the same mechanism extensible.API
Testing
pnpm exec jest test/providers.test.tspassesAPI.mdregenerated viapnpm docgenRelated: #524 (custom EC2 tags at launch time).
Made with Cursor