Skip to content

feat(storage): add shared DynamoDB runner storage - #5279

Draft
edersonbrilhante wants to merge 13 commits into
mainfrom
feat-dynamodb-storage-provider
Draft

edersonbrilhante wants to merge 13 commits into
mainfrom
feat-dynamodb-storage-provider

Conversation

@edersonbrilhante

@edersonbrilhante edersonbrilhante commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds an opt-in aws_dynamodb runner-config storage provider for experimental multi-runner v2 deployments.

  • Creates exactly two shared tables for the whole multi-runner deployment:
    • <prefix>-config for durable global and entry-scoped configuration, including GitHub App credentials, webhook secret, matcher config, runner bootstrap config, and runner-group cache.
    • <prefix>-runner-state for TTL-backed one-time runner configuration plus provider-neutral runner lifecycle/inventory records.
  • Uses scope and id keys to isolate global, runner-entry, lifecycle, and compute-resource records without creating a table per runner entry.
  • Adds DynamoDB implementations for runner config, runner-group cache, matcher config, GitHub App credentials, webhook secret, and lifecycle state.
  • Makes scale-up, pool, and scale-down reconcile capacity through the durable inventory while preserving provider discovery as a recovery source.
  • Lets EC2 runners atomically consume only their own unexpired runner configuration and retains EC2 tags for compatibility.
  • Wires least-privilege DynamoDB IAM, encrypted tables, TTL, seed readiness, and opaque configuration-version rotation into webhook and control-plane Lambdas.
  • Keeps v1 and omitted v2 configuration on aws_ssm. The termination watcher intentionally remains on SSM in this PR.

DynamoDB selection requires direct GitHub App values; externally managed *_ssm references continue using the SSM provider so Terraform does not copy those external SecureStrings into state.

Test Plan

  • Lambda Vitest suite: 68 files / 1,037 tests passed.
  • TypeScript tsc --noEmit: control-plane, storage-providers, and webhook passed.
  • ESLint and Prettier checks passed for the changed Lambda packages.
  • Terraform and OpenTofu tests for the new DynamoDB provider: 4/4 passed in each CLI.
  • Multi-runner v2 Terraform tests: 36/36 passed.
  • Stable v1 Terraform tests: 2/2 passed.
  • terraform validate: storage provider, multi-runner, and webhook modules passed.
  • Targeted TFLint for the new DynamoDB provider passed.
  • terraform fmt -check -recursive and git diff --check passed.
  • No deployment was performed.

Related Issues

Credits to @wadherv ##5266

@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 1 package(s) with unknown licenses.
See the Details below.

License Issues

lambdas/functions/webhook/package.json

PackageVersionLicenseIssue Type
@aws-github-runner/storage-providersNullUnknown License

OpenSSF Scorecard

Scorecard details
PackageVersionScoreDetails
npm/@aws-github-runner/storage-providers UnknownUnknown
npm/@aws-sdk/client-dynamodb ^3.1009.0 UnknownUnknown
npm/@aws-sdk/client-dynamodb 3.1124.0 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/core 3.977.9 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/credential-provider-env 3.972.70 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/credential-provider-http 3.972.72 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/credential-provider-ini 3.973.15 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/credential-provider-login 3.972.77 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/credential-provider-node 3.972.82 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/credential-provider-process 3.972.70 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/credential-provider-sso 3.973.14 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/credential-provider-web-identity 3.972.76 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/dynamodb-codec 3.973.44 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/endpoint-cache 3.972.11 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/middleware-endpoint-discovery 3.972.30 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/nested-clients 3.997.44 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/signature-v4-multi-region 3.996.46 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/token-providers 3.1116.0 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/types 3.974.5 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws-sdk/xml-builder 3.972.40 🟢 6.9
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 1/30 approved changesets -- score normalized to 0
Token-Permissions🟢 5detected GitHub workflow tokens with excessive permissions
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection🟢 5branch protection is not maximal on development and all release branches
Security-Policy🟢 10security policy file detected
Packaging🟢 10packaging workflow detected
SAST🟢 10SAST tool is run on all commits
Binary-Artifacts🟢 9binaries present in source code
Pinned-Dependencies🟢 8dependency not pinned by hash detected -- score normalized to 8
Fuzzing🟢 10project is fuzzed
npm/@aws/lambda-invoke-store 0.3.0 UnknownUnknown
npm/@smithy/core 3.33.3 UnknownUnknown
npm/@smithy/credential-provider-imds 4.5.2 UnknownUnknown
npm/@smithy/fetch-http-handler 5.7.2 UnknownUnknown
npm/@smithy/node-http-handler 4.11.3 UnknownUnknown
npm/@smithy/signature-v4 5.7.3 UnknownUnknown
npm/@smithy/types 4.17.2 UnknownUnknown
npm/mnemonist 0.38.3 🟢 3.1
Details
CheckScoreReason
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Code-Review🟢 3Found 10/30 approved changesets -- score normalized to 3
Packaging⚠️ -1packaging workflow not detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing⚠️ 0project is not fuzzed
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
Security-Policy⚠️ 0security policy file not detected
npm/obliterator 1.6.1 UnknownUnknown

Scanned Files

  • lambdas/functions/webhook/package.json
  • lambdas/libs/storage-providers/package.json
  • lambdas/yarn.lock

@edersonbrilhante
edersonbrilhante force-pushed the refactor-webhook-matcher-config-storage branch from 0150fb2 to 365ec35 Compare August 19, 2026 14:13
@edersonbrilhante
edersonbrilhante force-pushed the refactor-webhook-matcher-config-storage branch from 365ec35 to ccdd653 Compare September 3, 2026 13:09

@guicaulada guicaulada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good!

One suggestion on scale-down related to orphan runners: it would be nice if we could retry cleanup. Could be a subject for a follow-up PR.

Another point is related to KMS, I don't think the Lambda and runner roles have access to KMS to read encrypted tables.

Feel free to correct me if I'm missing something here!

}
} else {
await unMarkOrphan(runner.id, computeProvider);
await unMarkOrphan(runner, computeProvider);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A runner can get stuck if scale-down sets its state to terminating and then crashes before removing it from GitHub. On the next run, the runner is still registered in GitHub, so this branch calls unMarkOrphan. That function does not clear terminating, and normal scale-down skips runners in that state—even after the termination claim expires.

Please let a later scale-down run take over an expired termination claim and retry cleanup. Before removing the runner, check whether it is now busy so we do not interrupt a job.

I reproduced this with an online, idle runner whose termination claim was one hour old: scale-down never called beginTermination to retry cleanup.

@edersonbrilhante
edersonbrilhante force-pushed the refactor-webhook-matcher-config-storage branch from ccdd653 to 1e91aa2 Compare September 8, 2026 20:42
@edersonbrilhante
edersonbrilhante force-pushed the feat-dynamodb-storage-provider branch from 0563c7c to 2c05467 Compare September 8, 2026 21:15
@edersonbrilhante
edersonbrilhante force-pushed the feat-dynamodb-storage-provider branch from 08afbd2 to 97d9141 Compare September 8, 2026 21:23
@edersonbrilhante
edersonbrilhante changed the base branch from refactor-webhook-matcher-config-storage to main September 8, 2026 21:39
@edersonbrilhante
edersonbrilhante force-pushed the feat-dynamodb-storage-provider branch from 97d9141 to 1d9fa0e Compare September 8, 2026 21:41
@Brend-Smits

Copy link
Copy Markdown
Contributor

Nice work on this , the scope/id composite key plus native TTL is a clean way to avoid a table-per-entry, and reusing computeResourceId/computeProvider to keep things provider-neutral sets this up well for future compute providers.

One question on the isolation model: RunnerConfigRecord.accessScope (e.g. the EC2 instance ARN) is used as the partition key for the JIT/registration secret, but the interface only exposes create().
Is there a plan for the runner's own read path to be scoped by an IAM condition tied to its own compute identity (e.g. something like dynamodb:LeadingKeys conditioned on the instance's own ARN for EC2), so a runner can only ever fetch its own row? Right now the isolation looks like it depends on the control-plane always writing the correct scope, rather than being enforced by DynamoDB/IAM itself. Worth confirming/documenting how that's intended to work before this is broadly adopted, since it's the difference between "app convention" and "hard boundary."

On extensibility: this scope/id design also seems like a natural fit for replacing per-instance tagging (job context, etc.) with DynamoDB attributes on the same runner-state row, and eventually giving runners a place to read their own operational metadata back. If that's on the roadmap, it might be worth keeping the secret JIT-config item and any future metadata item under separate ids within the same scope from the start, so a metrics/read path never has access to the secret payload.

For instance, internally we have a similar setup which we protect using IAM policies with something like this:

"Condition": {
  "ForAllValues:StringEquals": { "dynamodb:LeadingKeys": ["${ec2:SourceInstanceARN}"] }
}

This way the instance itself is only able to read it's own data.

@edersonbrilhante
edersonbrilhante force-pushed the feat-dynamodb-storage-provider branch from 1d9fa0e to 045a518 Compare September 10, 2026 18:56
@edersonbrilhante
edersonbrilhante force-pushed the feat-dynamodb-storage-provider branch from 045a518 to 9a9c2cc Compare September 18, 2026 19:22
@edersonbrilhante
edersonbrilhante force-pushed the feat-dynamodb-storage-provider branch from 9a9c2cc to 2564213 Compare September 18, 2026 19:52
@edersonbrilhante
edersonbrilhante removed this pull request from stack #5396 September 18, 2026 19:53
tehlers320 added a commit to tehlers320/terraform-aws-github-runner that referenced this pull request Nov 17, 2026
…ig store

The DynamoDB runner config store keys one-time registration/JIT config on the
compute identity so that IAM can restrict each runner to its own record. Add an
optional getRunnerConfigAccessScope hook to StartRunnerConfigOptions and have the
EC2 provider supply the instance ARN from EC2_INSTANCE_ARN_PREFIX (set by the
DynamoDB wiring). SSM deployments never set it and keep writing the same record.

Based on the accessScope handling in github-aws-runners#5279.

Signed-off-by: tehlers320 <[email protected]>
tehlers320 added a commit to tehlers320/terraform-aws-github-runner that referenced this pull request Nov 23, 2026
Prerequisite contract for the DynamoDB runner config store ported from
github-aws-runners#5279/github-aws-runners#5458 (see review on github-aws-runners#5458: core lacked RunnerConfigRecord.accessScope).
Optional, so the SSM provider is unaffected.

Signed-off-by: tehlers320 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
tehlers320 added a commit to tehlers320/terraform-aws-github-runner that referenced this pull request Nov 23, 2026
…ders

Compose the DynamoDB runner config, runner group cache and GitHub App
credentials stores when RUNNER_CONFIG_STORAGE_PROVIDER=aws_dynamodb, and make
RunnerConfigStorage.consumer optional (EC2 runners consume their own config in
the instance bootstrap, the control plane never calls it).

Builds on github-aws-runners#5279 / github-aws-runners#5458 (edersonbrilhante) and github-aws-runners#5266 (wadherv).

Signed-off-by: tehlers320 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
tehlers320 added a commit to tehlers320/terraform-aws-github-runner that referenced this pull request Nov 23, 2026
…ig store

The DynamoDB runner config store keys one-time registration/JIT config on the
compute identity so that IAM can restrict each runner to its own record. Add an
optional getRunnerConfigAccessScope hook to StartRunnerConfigOptions and have the
EC2 provider supply the instance ARN from EC2_INSTANCE_ARN_PREFIX (set by the
DynamoDB wiring). SSM deployments never set it and keep writing the same record.

Based on the accessScope handling in github-aws-runners#5279.

Signed-off-by: tehlers320 <[email protected]>

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants