cdk-github-runner-switch 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -102,6 +102,7 @@ To flip the switch by hand: `gh variable set RUNNER --body aws` (or `github`).
102
102
  | `nodeMajorVersion` | `24` | Node.js installed in the image. |
103
103
  | `cachedImages` | `[]` | Container images pulled into the AMI, for faster `services:`. |
104
104
  | `extraImageCommands` | `[]` | Extra setup, e.g. `npx -y playwright install-deps chromium`. |
105
+ | `secret` | new secret | Reuse an existing secret with `webhookSecret`, `appId` and `privateKey` (e.g. when migrating). |
105
106
  | `imageSchedule` | monthly (day 1, 05:00 UTC) | EventBridge cron for the image rebuild. |
106
107
  | `reconcileInterval` / `usageCheckInterval` | 5 min / 30 min | |
107
108
 
@@ -45,6 +45,11 @@ export interface GitHubRunnerSwitchProps {
45
45
  readonly extraImageCommands?: string[];
46
46
  /** When the image is rebuilt (EventBridge cron, UTC). @default 'cron(0 5 1 * ? *)' — monthly, day 1 at 05:00 */
47
47
  readonly imageSchedule?: string;
48
+ /**
49
+ * Existing secret with `webhookSecret`, `appId` and `privateKey` (and `billingToken` for personal accounts), e.g. when
50
+ * migrating an existing setup. @default - a new secret with a generated `webhookSecret`
51
+ */
52
+ readonly secret?: secretsmanager.ISecret;
48
53
  /** @default Duration.minutes(5) */
49
54
  readonly reconcileInterval?: Duration;
50
55
  /** @default Duration.minutes(30) */
@@ -149,7 +149,7 @@ class GitHubRunnerSwitch extends constructs_1.Construct {
149
149
  });
150
150
  this.imagePipelineArn = pipeline.attrArn;
151
151
  // GitHub App credentials: the webhook secret is generated here; the setup script adds appId and privateKey.
152
- const secret = new secretsmanager.Secret(this, 'AppSecret', {
152
+ const secret = props.secret ?? new secretsmanager.Secret(this, 'AppSecret', {
153
153
  description: `GitHub App of the runners for ${props.repository} (cdk-github-runner-switch)`,
154
154
  generateSecretString: {
155
155
  secretStringTemplate: JSON.stringify({ appId: '', privateKey: '' }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdk-github-runner-switch",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "AWS CDK construct: GitHub Actions runners that switch from GitHub-hosted free minutes to disposable EC2 Spot (Graviton) machines when the monthly minutes run out — and back when the month resets.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "uarch-solutions",