@pipeline-builder/pipeline-manager 6.3.11 → 6.4.1

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.
Files changed (72) hide show
  1. package/dist/boilerplate.js +4 -3
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +7 -3
  4. package/dist/commands/create-pipeline.d.ts.map +1 -1
  5. package/dist/commands/create-pipeline.js +11 -3
  6. package/dist/commands/deploy-job.d.ts +74 -0
  7. package/dist/commands/deploy-job.d.ts.map +1 -0
  8. package/dist/commands/deploy-job.js +551 -0
  9. package/dist/commands/register.d.ts.map +1 -1
  10. package/dist/commands/register.js +2 -1
  11. package/dist/commands/runner-signing-key.js +2 -2
  12. package/dist/commands/setup-runner.d.ts +45 -1
  13. package/dist/commands/setup-runner.d.ts.map +1 -1
  14. package/dist/commands/setup-runner.js +226 -19
  15. package/dist/commands/store-token.d.ts +5 -2
  16. package/dist/commands/store-token.d.ts.map +1 -1
  17. package/dist/commands/store-token.js +13 -5
  18. package/dist/commands/validate-templates.js +14 -8
  19. package/dist/config/cli.constants.d.ts +3 -22
  20. package/dist/config/cli.constants.d.ts.map +1 -1
  21. package/dist/config/cli.constants.js +6 -42
  22. package/dist/lambda/runner-deploy.d.ts +44 -0
  23. package/dist/lambda/runner-deploy.d.ts.map +1 -0
  24. package/dist/lambda/runner-deploy.js +212 -0
  25. package/dist/lambda/runner-handler.d.ts +28 -8
  26. package/dist/lambda/runner-handler.d.ts.map +1 -1
  27. package/dist/lambda/runner-handler.js +406 -15
  28. package/dist/lambda/runner-jws.d.ts +8 -0
  29. package/dist/lambda/runner-jws.d.ts.map +1 -1
  30. package/dist/lambda/runner-jws.js +66 -2
  31. package/dist/templates/runner-stack.json +449 -1
  32. package/dist/templates/token-renew-stack.json +1 -1
  33. package/dist/utils/api-client.d.ts +7 -0
  34. package/dist/utils/api-client.d.ts.map +1 -1
  35. package/dist/utils/api-client.js +1 -1
  36. package/dist/utils/cdk-bootstrap.d.ts +18 -0
  37. package/dist/utils/cdk-bootstrap.d.ts.map +1 -0
  38. package/dist/utils/cdk-bootstrap.js +41 -0
  39. package/dist/utils/cdk-utils.d.ts +15 -0
  40. package/dist/utils/cdk-utils.d.ts.map +1 -1
  41. package/dist/utils/cdk-utils.js +70 -2
  42. package/dist/utils/deploy-assembly.d.ts +18 -0
  43. package/dist/utils/deploy-assembly.d.ts.map +1 -0
  44. package/dist/utils/deploy-assembly.js +87 -0
  45. package/dist/utils/deploy-runner.d.ts +26 -1
  46. package/dist/utils/deploy-runner.d.ts.map +1 -1
  47. package/dist/utils/deploy-runner.js +26 -16
  48. package/dist/utils/deploy-session-client.d.ts +69 -0
  49. package/dist/utils/deploy-session-client.d.ts.map +1 -0
  50. package/dist/utils/deploy-session-client.js +171 -0
  51. package/dist/utils/pipeline-config.d.ts +8 -6
  52. package/dist/utils/pipeline-config.d.ts.map +1 -1
  53. package/dist/utils/pipeline-config.js +15 -14
  54. package/dist/utils/plugin-resolver.d.ts +2 -2
  55. package/dist/utils/plugin-resolver.d.ts.map +1 -1
  56. package/dist/utils/plugin-resolver.js +1 -2
  57. package/dist/utils/registry.d.ts +16 -0
  58. package/dist/utils/registry.d.ts.map +1 -1
  59. package/dist/utils/registry.js +11 -6
  60. package/dist/utils/runner-template.d.ts +32 -0
  61. package/dist/utils/runner-template.d.ts.map +1 -1
  62. package/dist/utils/runner-template.js +64 -2
  63. package/dist/utils/service-account.d.ts +2 -0
  64. package/dist/utils/service-account.d.ts.map +1 -1
  65. package/dist/utils/service-account.js +2 -2
  66. package/dist/utils/synth-stack-name.d.ts +13 -0
  67. package/dist/utils/synth-stack-name.d.ts.map +1 -0
  68. package/dist/utils/synth-stack-name.js +15 -0
  69. package/dist/utils/toolchain.d.ts +2 -2
  70. package/dist/utils/toolchain.d.ts.map +1 -1
  71. package/dist/utils/toolchain.js +1 -1
  72. package/package.json +7 -4
@@ -1,10 +1,12 @@
1
1
  // src/lambda/runner-handler.ts
2
+ import { CodeBuildClient } from "@aws-sdk/client-codebuild";
2
3
  import {
3
4
  CodePipelineClient,
4
5
  GetPipelineExecutionCommand,
5
6
  StartPipelineExecutionCommand,
6
7
  StopPipelineExecutionCommand
7
8
  } from "@aws-sdk/client-codepipeline";
9
+ import { KMSClient } from "@aws-sdk/client-kms";
8
10
  import { GetResourcesCommand, ResourceGroupsTaggingAPIClient } from "@aws-sdk/client-resource-groups-tagging-api";
9
11
 
10
12
  // ../api-core/lib/types/pipeline-runners.js
@@ -12,7 +14,15 @@ var PIPELINE_ID_TAG = "pb.pipeline-id";
12
14
  function runnerJwksPath(runnerId) {
13
15
  return `/api/pipelines/runner/runners/${encodeURIComponent(runnerId)}/jwks.json`;
14
16
  }
15
- var RUNNER_ACTIONS = ["start", "stop", "probe", "ping", "status"];
17
+ var RUNNER_ACTIONS = ["start", "stop", "probe", "ping", "status", "deploy", "deploy_status", "deploy_cancel", "undeploy"];
18
+ var DEPLOY_CAPABILITY = "deploy:1";
19
+ var DEPLOY_ACTION_CAPABILITY = {
20
+ deploy: DEPLOY_CAPABILITY,
21
+ deploy_status: DEPLOY_CAPABILITY,
22
+ deploy_cancel: DEPLOY_CAPABILITY,
23
+ undeploy: DEPLOY_CAPABILITY
24
+ };
25
+ var AWS_REGION_PATTERN = /^[a-z]{2}(-[a-z]+)+-\d{1,2}$/;
16
26
  var RUNNER_ERRORS = {
17
27
  // -- The pipeline service's answers --
18
28
  RUNNERS_UNAVAILABLE: { httpStatus: 409, retryable: false, category: "platform" },
@@ -45,6 +55,33 @@ var RUNNER_ERRORS = {
45
55
  RUNNER_KEY_MODE_ROOT_ORG: { httpStatus: 409, retryable: false, category: "platform" },
46
56
  /** Revoke: the typed confirmation is not the last {@link RUNNER_KEY_REVOKE_CONFIRM_CHARS} characters of the active kid. */
47
57
  RUNNER_KEY_CONFIRMATION_MISMATCH: { httpStatus: 400, retryable: false, category: "platform" },
58
+ // -- Deploys through a runner (the pipeline service's answers) --
59
+ /** The runner does not list the `deploy:1` capability (an old bundle, or a stack without --enable-deploy): update it with {@link DEPLOY_SETUP_COMMAND}. */
60
+ RUNNER_DEPLOY_UNSUPPORTED: { httpStatus: 409, retryable: false, category: "platform" },
61
+ /** Several runners can deploy this pipeline and none was named (`details.runners`: the deployable ones). */
62
+ DEPLOY_RUNNER_REQUIRED: { httpStatus: 409, retryable: false, category: "platform" },
63
+ /** The runner named (or the only one) cannot deploy this pipeline (`details.reason`: a {@link DeployTargetReason}). */
64
+ RUNNER_NOT_DEPLOYABLE: { httpStatus: 409, retryable: false, category: "platform" },
65
+ /** The pipeline already has a registry row: deploys through a runner are for a never-deployed pipeline only. */
66
+ ALREADY_DEPLOYED: { httpStatus: 409, retryable: false, category: "platform" },
67
+ /**
68
+ * Another deploy of this pipeline is active (`details.requestId`). Also what a
69
+ * runner answers when its project already builds this pipeline for another
70
+ * request id (the one platform code a runner may send: final, like any 4xx).
71
+ */
72
+ DEPLOY_IN_PROGRESS: { httpStatus: 409, retryable: false, category: "platform" },
73
+ /** The region asked for is not one of the runner's allowed regions (or several are and none was named). */
74
+ DEPLOY_REGION_NOT_ALLOWED: { httpStatus: 409, retryable: false, category: "platform" },
75
+ /** The pipeline's pinned toolchain release ships no cdk-synth image speaking {@link DEPLOY_JOB_PROTOCOL_VERSION}. */
76
+ TOOLCHAIN_TOO_OLD_FOR_DEPLOY: { httpStatus: 409, retryable: false, category: "platform" },
77
+ /** Cancel of a deploy that already finished. */
78
+ DEPLOY_NOT_CANCELLABLE: { httpStatus: 409, retryable: false, category: "platform" },
79
+ /** DEPLOY_REQUESTS_PER_HOUR for the org. */
80
+ DEPLOY_RATE_LIMITED: { httpStatus: 429, retryable: false, category: "platform" },
81
+ /** MAX_ACTIVE_DEPLOYS_PER_RUNNER deploys already active on the runner. */
82
+ TOO_MANY_DEPLOYS: { httpStatus: 429, retryable: false, category: "platform" },
83
+ /** The deploy job's grant (or session) was refused (`details.reason`: a {@link DeployGrantRejectionReason}). */
84
+ DEPLOY_GRANT_INVALID: { httpStatus: 401, retryable: false, category: "platform" },
48
85
  // -- A runner's answers --
49
86
  SIGNATURE_INVALID: { httpStatus: 401, retryable: false, category: "runner" },
50
87
  RUNNER_REFUSED: { httpStatus: 403, retryable: false, category: "runner" },
@@ -65,6 +102,15 @@ var RUNNER_ERRORS = {
65
102
  * this code.
66
103
  */
67
104
  RUNNER_ERROR: { httpStatus: 500, retryable: false, category: "runner" },
105
+ // -- A runner's answers to the deploy actions --
106
+ /** The stack was not set up with --enable-deploy (the platform clears the runner's stored capabilities). */
107
+ DEPLOY_NOT_ENABLED: { httpStatus: 403, retryable: false, category: "runner" },
108
+ /** A pipeline tagged with this pipeline id already exists in the account (the platform links it instead). */
109
+ PIPELINE_ALREADY_DEPLOYED: { httpStatus: 409, retryable: false, category: "runner" },
110
+ /** The deploy project is at its concurrent build limit (delivered again). */
111
+ DEPLOY_BUSY: { httpStatus: 409, retryable: true, category: "runner" },
112
+ /** deploy_status / deploy_cancel: no such build in the runner's own deploy project. */
113
+ DEPLOY_BUILD_NOT_FOUND: { httpStatus: 404, retryable: false, category: "runner" },
68
114
  // -- Recorded by the platform --
69
115
  /** Not delivered within the request's lifetime. */
70
116
  RUN_REQUEST_EXPIRED: { httpStatus: null, retryable: false, category: "recorded" },
@@ -91,6 +137,139 @@ var RUN_REQUEST_MAX_LIFETIME_SECONDS = RUN_REQUEST_TTL_MS / 1e3;
91
137
  var RUN_REQUEST_CLOCK_SKEW_SECONDS = 120;
92
138
  var RUNNER_KEY_ACTIVATION_DELAY_MS = 10 * 6e4;
93
139
  var RUNNER_KEY_RETIRE_WINDOW_MS = 60 * 6e4;
140
+ var RUNNER_TUNABLE_DEFAULTS = {
141
+ RUN_REQUESTS_PER_MINUTE: "6",
142
+ MAX_PENDING_PER_ORG: "500",
143
+ MAX_IN_FLIGHT_PER_RUNNER: "8",
144
+ RUNNER_HEALTH_PING_INTERVAL_SECONDS: "60",
145
+ RUNNER_UNHEALTHY_AFTER_PINGS: "2",
146
+ RUNNER_KEY_MAX_AGE_DAYS: "365",
147
+ DEPLOY_REQUESTS_PER_HOUR: "20",
148
+ MAX_ACTIVE_DEPLOYS_PER_RUNNER: "2",
149
+ RUNNER_DEPLOY_DEADLINE_MINUTES: "120",
150
+ RUNNER_DEPLOY_STATUS_POLL_SECONDS: "30"
151
+ };
152
+ var DEPLOY_STAGES = [
153
+ "queued",
154
+ "starting",
155
+ "authenticating",
156
+ "fetching",
157
+ "prechecking",
158
+ "cleaning",
159
+ "synthesizing",
160
+ "deploying",
161
+ "registering",
162
+ "removing",
163
+ "done"
164
+ ];
165
+ var CODEBUILD_BUILD_STATES = {
166
+ IN_PROGRESS: "in_progress",
167
+ SUCCEEDED: "succeeded",
168
+ FAILED: "failed",
169
+ FAULT: "failed",
170
+ STOPPED: "stopped",
171
+ TIMED_OUT: "timed_out"
172
+ };
173
+ function deployBuildState(codebuildStatus) {
174
+ if (!codebuildStatus)
175
+ return "in_progress";
176
+ return Object.hasOwn(CODEBUILD_BUILD_STATES, codebuildStatus) ? CODEBUILD_BUILD_STATES[codebuildStatus] : "failed";
177
+ }
178
+ var RUNNER_DEPLOY_ERRORS = {
179
+ /** The job's grant exchange was refused (reused, unknown, wrong state). */
180
+ DEPLOY_GRANT_REJECTED: { class: "platform", retryable: false },
181
+ /** The grant expired before the job exchanged it ({@link DEPLOY_GRANT_TTL_MS}): the build queued too long. */
182
+ DEPLOY_GRANT_EXPIRED: { class: "platform", retryable: true },
183
+ /** The job could not read the pipeline through its session. */
184
+ PIPELINE_FETCH_FAILED: { class: "platform", retryable: true },
185
+ /** A plugin of the pipeline did not resolve (lookup through the session). */
186
+ PLUGIN_RESOLUTION_FAILED: { class: "definition", retryable: false },
187
+ /** The synthesized pipeline / stack names or region are not the ones the request named. */
188
+ DEPLOY_TARGET_MISMATCH: { class: "definition", retryable: false },
189
+ /** A stack of that name exists and is not this pipeline's (tagged for another pipeline, or untagged). */
190
+ STACK_OWNED_BY_OTHER_PIPELINE: { class: "definition", retryable: false },
191
+ /** The target region has no CDK bootstrap (`pipeline-manager bootstrap --region <r>`). */
192
+ CDK_NOT_BOOTSTRAPPED: { class: "account_setup", retryable: true },
193
+ /** The region's CDK bootstrap is older than the toolchain needs. */
194
+ CDK_BOOTSTRAP_OUTDATED: { class: "account_setup", retryable: true },
195
+ /** Secrets the pipeline needs are not in the account's Secrets Manager. */
196
+ ACCOUNT_SECRETS_MISSING: { class: "account_setup", retryable: true },
197
+ /** A bootstrap role refused an AWS call (or the permissions boundary did). */
198
+ DEPLOY_PERMISSION_DENIED: { class: "aws_permission", retryable: true },
199
+ /** `cdk deploy` failed in CloudFormation. */
200
+ CFN_DEPLOY_FAILED: { class: "cloudformation", retryable: true },
201
+ /** Deleting this pipeline's stack (cleaning a failed first deploy, or an undeploy) did not reach DELETE_COMPLETE. */
202
+ STACK_DELETE_FAILED: { class: "cloudformation", retryable: true },
203
+ /** CodeBuild could not pull the cdk-synth image (registry credential or host). */
204
+ DEPLOY_IMAGE_PULL_FAILED: { class: "image", retryable: true },
205
+ /** The image's deploy-job protocol is not the claim's ({@link DEPLOY_JOB_PROTOCOL_VERSION}). */
206
+ DEPLOY_JOB_PROTOCOL_MISMATCH: { class: "image", retryable: false },
207
+ /**
208
+ * The synthesized stack has Docker image assets: the deploy build is never
209
+ * privileged (no such mode exists on the runner), so a retry fails the same
210
+ * way. A runtime guard — the stacks this product synthesizes carry none.
211
+ */
212
+ DEPLOY_NEEDS_PRIVILEGED: { class: "image", retryable: false },
213
+ /** Past RUNNER_DEPLOY_DEADLINE_MINUTES, or CodeBuild's own timeout. */
214
+ DEPLOY_TIMED_OUT: { class: "timeout", retryable: true },
215
+ /** A person cancelled it. */
216
+ DEPLOY_CANCELLED: { class: "cancelled", retryable: true },
217
+ /** Anything else inside the job. */
218
+ DEPLOY_JOB_ERROR: { class: "unknown", retryable: true }
219
+ };
220
+ var RUNNER_DEPLOY_ERROR_CODES = Object.keys(RUNNER_DEPLOY_ERRORS);
221
+ function isRunnerDeployErrorCode(code) {
222
+ return typeof code === "string" && Object.prototype.hasOwnProperty.call(RUNNER_DEPLOY_ERRORS, code);
223
+ }
224
+ var DEPLOY_RESULT_OK = "OK";
225
+ var DEPLOY_JOB_RESULT_CODES = [DEPLOY_RESULT_OK, ...RUNNER_DEPLOY_ERROR_CODES];
226
+ function isDeployJobResultCode(code) {
227
+ return code === DEPLOY_RESULT_OK || isRunnerDeployErrorCode(code);
228
+ }
229
+ var DEPLOY_GRANT_PATTERN = /^pb_dg_[A-Za-z0-9_-]{43}$/;
230
+ var DEPLOY_BUILD_QUEUED_TIMEOUT_MINUTES = 30;
231
+ var DEPLOY_GRANT_PROVISIONING_MARGIN_MS = 15 * 6e4;
232
+ function deployGrantTtlMs(queuedTimeoutMinutes = DEPLOY_BUILD_QUEUED_TIMEOUT_MINUTES) {
233
+ return Math.max(RUN_REQUEST_TTL_MS, queuedTimeoutMinutes * 6e4 + DEPLOY_GRANT_PROVISIONING_MARGIN_MS);
234
+ }
235
+ var DEPLOY_GRANT_TTL_MS = deployGrantTtlMs();
236
+ var DEPLOY_BUILD_TIMEOUT_MINUTES = {
237
+ default: 60,
238
+ min: 10,
239
+ max: Number(RUNNER_TUNABLE_DEFAULTS.RUNNER_DEPLOY_DEADLINE_MINUTES)
240
+ };
241
+ var DEPLOY_GRANT_KMS_PURPOSE = "deploy-grant";
242
+ function deployGrantEncryptionContext(runnerId, requestId) {
243
+ return { runnerId, purpose: DEPLOY_GRANT_KMS_PURPOSE, requestId };
244
+ }
245
+ var DEPLOY_JOB_IMAGE_REPOSITORY = "system/cdk-synth";
246
+ var DEPLOY_IMAGE_DIGEST_PATTERN = /^sha256:[0-9a-f]{64}$/;
247
+ var DEPLOY_JOB_MODES = ["deploy", "undeploy"];
248
+ var DEPLOY_JOB_ENV = {
249
+ requestId: "PB_REQUEST_ID",
250
+ pipelineId: "PB_PIPELINE_ID",
251
+ region: "PB_TARGET_REGION",
252
+ pipelineName: "PB_PIPELINE_NAME",
253
+ stackName: "PB_STACK_NAME",
254
+ grantCiphertext: "PB_DEPLOY_GRANT_CIPHERTEXT",
255
+ toolchainRelease: "PB_TOOLCHAIN_RELEASE",
256
+ protocol: "PB_DEPLOY_PROTOCOL",
257
+ mode: "PB_JOB_MODE",
258
+ result: "PB_DEPLOY_RESULT",
259
+ stage: "PB_DEPLOY_STAGE"
260
+ };
261
+ var DEPLOY_JOB_EXPORTED_VARIABLES = [DEPLOY_JOB_ENV.result, DEPLOY_JOB_ENV.stage];
262
+ var DEPLOY_JOB_OVERRIDE_ENV = [
263
+ DEPLOY_JOB_ENV.requestId,
264
+ DEPLOY_JOB_ENV.pipelineId,
265
+ DEPLOY_JOB_ENV.region,
266
+ DEPLOY_JOB_ENV.pipelineName,
267
+ DEPLOY_JOB_ENV.stackName,
268
+ DEPLOY_JOB_ENV.grantCiphertext,
269
+ DEPLOY_JOB_ENV.toolchainRelease,
270
+ DEPLOY_JOB_ENV.protocol,
271
+ DEPLOY_JOB_ENV.mode
272
+ ];
94
273
 
95
274
  // src/lambda/pipeline-tag.ts
96
275
  import { ListTagsForResourceCommand } from "@aws-sdk/client-codepipeline";
@@ -105,6 +284,145 @@ async function readPipelineIdTag(cp, resourceArn) {
105
284
  return void 0;
106
285
  }
107
286
 
287
+ // src/lambda/runner-deploy.ts
288
+ import {
289
+ BatchGetBuildsCommand,
290
+ ListBuildsForProjectCommand,
291
+ StartBuildCommand,
292
+ StopBuildCommand
293
+ } from "@aws-sdk/client-codebuild";
294
+ import { EncryptCommand } from "@aws-sdk/client-kms";
295
+ var REGISTRY_PULL_HOST_PATTERN = /^[A-Za-z0-9.-]+(:[0-9]{1,5})?$/;
296
+ function deployConfigFromEnv(env) {
297
+ if (env.DEPLOY_ENABLED?.trim() !== "true") return { enabled: false };
298
+ const need = (name) => {
299
+ const v = env[name]?.trim();
300
+ if (!v) throw new Error(`${name} environment variable is required when DEPLOY_ENABLED=true`);
301
+ return v;
302
+ };
303
+ const registryPullHost = need("REGISTRY_PULL_HOST");
304
+ if (!REGISTRY_PULL_HOST_PATTERN.test(registryPullHost)) throw new Error("REGISTRY_PULL_HOST must be a host or host:port");
305
+ return {
306
+ enabled: true,
307
+ projectName: need("DEPLOY_PROJECT_NAME"),
308
+ registryPullHost,
309
+ registryCredentialSecret: need("REGISTRY_CREDENTIAL_SECRET"),
310
+ grantKeyArn: need("DEPLOY_GRANT_KEY_ARN")
311
+ };
312
+ }
313
+ var errName = (err) => String(err?.name ?? "");
314
+ var envOf = (b, name) => b.environment?.environmentVariables?.find((v) => v.name === name)?.value;
315
+ var exportedOf = (b, name) => b.exportedEnvironmentVariables?.find((v) => v.name === name)?.value;
316
+ async function recentBuilds(ctx, projectName) {
317
+ const listed = await ctx.codebuild.send(new ListBuildsForProjectCommand({ projectName, sortOrder: "DESCENDING" }));
318
+ const ids = (listed.ids ?? []).slice(0, 100);
319
+ if (ids.length === 0) return [];
320
+ const got = await ctx.codebuild.send(new BatchGetBuildsCommand({ ids }));
321
+ return got.builds ?? [];
322
+ }
323
+ async function startJob(ctx, claims) {
324
+ const cfg = ctx.config;
325
+ if (!cfg.enabled) return { refuse: "DEPLOY_NOT_ENABLED" };
326
+ const d = claims.deploy;
327
+ const pipelineId = claims.pipelineId;
328
+ if (!ctx.isAllowed(d.region, d.pipelineName)) return { refuse: "RUNNER_REFUSED" };
329
+ const builds = await recentBuilds(ctx, cfg.projectName);
330
+ const own = builds.find((b) => b.id && envOf(b, DEPLOY_JOB_ENV.requestId) === claims.jti);
331
+ if (own?.id) return { outcome: d.mode === "deploy" ? "deploying" : "undeploying", buildId: own.id };
332
+ if (d.mode === "deploy" && await ctx.alreadyDeployed(pipelineId)) return { refuse: "PIPELINE_ALREADY_DEPLOYED" };
333
+ if (builds.some((b) => deployBuildState(b.buildStatus) === "in_progress" && envOf(b, DEPLOY_JOB_ENV.pipelineId) === pipelineId)) {
334
+ return { refuse: "DEPLOY_IN_PROGRESS" };
335
+ }
336
+ const encrypted = await ctx.kms.send(new EncryptCommand({
337
+ KeyId: cfg.grantKeyArn,
338
+ Plaintext: Buffer.from(d.grant, "utf8"),
339
+ // Bound to this request (= the build's PB_REQUEST_ID): the ciphertext decrypts for its own build only.
340
+ EncryptionContext: deployGrantEncryptionContext(ctx.runnerId, claims.jti)
341
+ }));
342
+ if (!encrypted.CiphertextBlob || encrypted.CiphertextBlob.length === 0) throw new Error("KMS returned no ciphertext");
343
+ const ciphertext = Buffer.from(encrypted.CiphertextBlob).toString("base64");
344
+ const env = {
345
+ [DEPLOY_JOB_ENV.requestId]: claims.jti,
346
+ [DEPLOY_JOB_ENV.pipelineId]: pipelineId,
347
+ [DEPLOY_JOB_ENV.region]: d.region,
348
+ [DEPLOY_JOB_ENV.pipelineName]: d.pipelineName,
349
+ [DEPLOY_JOB_ENV.stackName]: d.stackName,
350
+ [DEPLOY_JOB_ENV.grantCiphertext]: ciphertext,
351
+ [DEPLOY_JOB_ENV.toolchainRelease]: d.toolchainRelease,
352
+ [DEPLOY_JOB_ENV.protocol]: String(d.protocol),
353
+ [DEPLOY_JOB_ENV.mode]: d.mode
354
+ };
355
+ let started;
356
+ try {
357
+ started = await ctx.codebuild.send(new StartBuildCommand({
358
+ projectName: cfg.projectName,
359
+ // A redelivery within CodeBuild's token window starts ONE build (the scan above covers the rest).
360
+ idempotencyToken: claims.jti,
361
+ imageOverride: `${cfg.registryPullHost}/${DEPLOY_JOB_IMAGE_REPOSITORY}@${d.image.digest}`,
362
+ imagePullCredentialsTypeOverride: "SERVICE_ROLE",
363
+ registryCredentialOverride: { credential: cfg.registryCredentialSecret, credentialProvider: "SECRETS_MANAGER" },
364
+ environmentVariablesOverride: Object.entries(env).map(([name, value]) => ({ name, value, type: "PLAINTEXT" }))
365
+ }));
366
+ } catch (err) {
367
+ if (errName(err) === "AccountLimitExceededException") return { refuse: "DEPLOY_BUSY" };
368
+ throw err;
369
+ }
370
+ if (!started.build?.id) throw new Error("StartBuild returned no build id");
371
+ return { outcome: d.mode === "deploy" ? "deploying" : "undeploying", buildId: started.build.id };
372
+ }
373
+ async function ownBuild(ctx, claims) {
374
+ const cfg = ctx.config;
375
+ if (!cfg.enabled) return { refuse: "DEPLOY_NOT_ENABLED" };
376
+ const buildId = claims.buildId;
377
+ if (!buildId.startsWith(`${cfg.projectName}:`)) return { refuse: "RUNNER_REFUSED" };
378
+ const got = await ctx.codebuild.send(new BatchGetBuildsCommand({ ids: [buildId] }));
379
+ const b = (got.builds ?? []).find((x) => x.id === buildId);
380
+ if (!b) return { refuse: "DEPLOY_BUILD_NOT_FOUND" };
381
+ if (b.projectName !== cfg.projectName) return { refuse: "RUNNER_REFUSED" };
382
+ if (envOf(b, DEPLOY_JOB_ENV.requestId) !== claims.deployRequestId) return { refuse: "RUNNER_REFUSED" };
383
+ if (envOf(b, DEPLOY_JOB_ENV.pipelineId) !== claims.pipelineId) return { refuse: "RUNNER_REFUSED" };
384
+ return b;
385
+ }
386
+ var isAnswer = (v) => "refuse" in v || "outcome" in v;
387
+ function reported(b, state) {
388
+ const rawStage = exportedOf(b, DEPLOY_JOB_ENV.stage);
389
+ const rawResult = exportedOf(b, DEPLOY_JOB_ENV.result);
390
+ let stage = DEPLOY_STAGES.includes(rawStage ?? "") ? rawStage : null;
391
+ let resultCode = isDeployJobResultCode(rawResult) ? rawResult : null;
392
+ if (state === "failed" && !resultCode && b.phases?.some((p) => p.phaseType === "PROVISIONING" && p.phaseStatus === "FAILED")) {
393
+ resultCode = "DEPLOY_IMAGE_PULL_FAILED";
394
+ stage = stage ?? "starting";
395
+ }
396
+ return { stage, resultCode };
397
+ }
398
+ async function buildStatus(ctx, claims) {
399
+ const b = await ownBuild(ctx, claims);
400
+ if (isAnswer(b)) return b;
401
+ const buildState = deployBuildState(b.buildStatus);
402
+ return { outcome: "deploy_status", buildState, ...reported(b, buildState) };
403
+ }
404
+ async function cancelBuild(ctx, claims) {
405
+ const b = await ownBuild(ctx, claims);
406
+ if (isAnswer(b)) return b;
407
+ const current = deployBuildState(b.buildStatus);
408
+ if (current !== "in_progress") return { outcome: "deploy_cancelled", buildState: current };
409
+ const stopped = await ctx.codebuild.send(new StopBuildCommand({ id: b.id }));
410
+ return { outcome: "deploy_cancelled", buildState: deployBuildState(stopped.build?.buildStatus) };
411
+ }
412
+ async function runDeployAction(ctx, claims) {
413
+ switch (claims.action) {
414
+ case "deploy":
415
+ case "undeploy":
416
+ return startJob(ctx, claims);
417
+ case "deploy_status":
418
+ return buildStatus(ctx, claims);
419
+ case "deploy_cancel":
420
+ return cancelBuild(ctx, claims);
421
+ default:
422
+ throw new Error(`not a deploy action: ${claims.action}`);
423
+ }
424
+ }
425
+
108
426
  // src/lambda/runner-jws.ts
109
427
  import { createPublicKey, verify as cryptoVerify } from "node:crypto";
110
428
  var JWKS_TTL_MS = 10 * 60 * 1e3;
@@ -243,6 +561,16 @@ async function verifyRunRequest(jws, opts) {
243
561
  }
244
562
  hint = { region: raw.region, pipelineName: raw.pipelineName };
245
563
  }
564
+ const takesBlock = action === "deploy" || action === "undeploy";
565
+ const takesBuild = action === "deploy_status" || action === "deploy_cancel";
566
+ if (!takesBlock && c.deploy !== void 0) throw new SignatureError("unexpected deploy claim");
567
+ if (!takesBuild && c.deployRequestId !== void 0) throw new SignatureError("unexpected deployRequestId");
568
+ if (!takesBuild && c.buildId !== void 0) throw new SignatureError("unexpected buildId");
569
+ const deploy = takesBlock ? parseDeployClaim(c.deploy, action) : void 0;
570
+ if (takesBuild) {
571
+ if (!isNonEmptyString(c.deployRequestId) || c.deployRequestId.length > 128) throw new SignatureError("missing deployRequestId");
572
+ if (typeof c.buildId !== "string" || !BUILD_ID_PATTERN.test(c.buildId)) throw new SignatureError("malformed buildId");
573
+ }
246
574
  return {
247
575
  iss: c.iss,
248
576
  aud: c.aud,
@@ -253,9 +581,40 @@ async function verifyRunRequest(jws, opts) {
253
581
  ...isNonEmptyString(c.pipelineId) ? { pipelineId: c.pipelineId } : {},
254
582
  ...hint ? { hint } : {},
255
583
  ...isNonEmptyString(c.executionId) ? { executionId: c.executionId } : {},
584
+ ...deploy ? { deploy } : {},
585
+ ...takesBuild ? { deployRequestId: c.deployRequestId, buildId: c.buildId } : {},
256
586
  requestedBy: c.requestedBy
257
587
  };
258
588
  }
589
+ var PIPELINE_NAME_PATTERN = /^[A-Za-z0-9.@_-]{1,100}$/;
590
+ var STACK_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9-]{0,127}$/;
591
+ var TOOLCHAIN_RELEASE_PATTERN = /^[0-9A-Za-z][0-9A-Za-z.+-]{0,63}$/;
592
+ var BUILD_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]{1,254}:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
593
+ function parseDeployClaim(raw, action) {
594
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) throw new SignatureError("missing deploy claim");
595
+ const d = raw;
596
+ if (typeof d.grant !== "string" || !DEPLOY_GRANT_PATTERN.test(d.grant)) throw new SignatureError("malformed deploy grant");
597
+ if (typeof d.protocol !== "number" || !Number.isInteger(d.protocol) || d.protocol < 1) throw new SignatureError("malformed deploy protocol");
598
+ if (!DEPLOY_JOB_MODES.includes(d.mode) || d.mode !== action) throw new SignatureError("deploy mode is not the action");
599
+ if (typeof d.region !== "string" || !AWS_REGION_PATTERN.test(d.region)) throw new SignatureError("malformed deploy region");
600
+ if (typeof d.pipelineName !== "string" || !PIPELINE_NAME_PATTERN.test(d.pipelineName)) throw new SignatureError("malformed deploy pipelineName");
601
+ if (typeof d.stackName !== "string" || !STACK_NAME_PATTERN.test(d.stackName)) throw new SignatureError("malformed deploy stackName");
602
+ const image = d.image;
603
+ if (!image || typeof image !== "object" || Array.isArray(image)) throw new SignatureError("missing deploy image");
604
+ if (image.repository !== DEPLOY_JOB_IMAGE_REPOSITORY) throw new SignatureError("deploy image repository is not the managed cdk-synth");
605
+ if (typeof image.digest !== "string" || !DEPLOY_IMAGE_DIGEST_PATTERN.test(image.digest)) throw new SignatureError("malformed deploy image digest");
606
+ if (typeof d.toolchainRelease !== "string" || !TOOLCHAIN_RELEASE_PATTERN.test(d.toolchainRelease)) throw new SignatureError("malformed deploy toolchainRelease");
607
+ return {
608
+ grant: d.grant,
609
+ protocol: d.protocol,
610
+ mode: d.mode,
611
+ region: d.region,
612
+ pipelineName: d.pipelineName,
613
+ stackName: d.stackName,
614
+ image: { repository: DEPLOY_JOB_IMAGE_REPOSITORY, digest: image.digest },
615
+ toolchainRelease: d.toolchainRelease
616
+ };
617
+ }
259
618
  var ReplayCache = class {
260
619
  constructor(now) {
261
620
  this.now = now;
@@ -301,7 +660,8 @@ function configFromEnv(env = process.env) {
301
660
  platformBaseUrl,
302
661
  allowedRegions,
303
662
  allowedPrefixes,
304
- version: env.RUNNER_VERSION?.trim() || "0.0.0"
663
+ version: env.RUNNER_VERSION?.trim() || "0.0.0",
664
+ deploy: deployConfigFromEnv(env)
305
665
  };
306
666
  }
307
667
  function defaultLog(level, msg, data) {
@@ -312,6 +672,8 @@ function defaultLog(level, msg, data) {
312
672
  function defaultDeps() {
313
673
  const tagging = /* @__PURE__ */ new Map();
314
674
  const cp = /* @__PURE__ */ new Map();
675
+ let codebuild;
676
+ let kms;
315
677
  return {
316
678
  fetch: (url, init) => fetch(url, init),
317
679
  now: () => Date.now(),
@@ -323,6 +685,8 @@ function defaultDeps() {
323
685
  if (!cp.has(region)) cp.set(region, new CodePipelineClient({ region }));
324
686
  return cp.get(region);
325
687
  },
688
+ codebuild: () => codebuild ??= new CodeBuildClient({}),
689
+ kms: () => kms ??= new KMSClient({}),
326
690
  log: defaultLog
327
691
  };
328
692
  }
@@ -341,10 +705,10 @@ function isAllowed(config, region, name) {
341
705
  if (!config.allowedRegions.includes(region)) return false;
342
706
  return config.allowedPrefixes.some((p) => p === "*" || name.startsWith(p));
343
707
  }
344
- var errName = (err) => String(err?.name ?? "");
708
+ var errName2 = (err) => String(err?.name ?? "");
345
709
  var errStatus = (err) => err?.$metadata?.httpStatusCode;
346
710
  function isAccessDenied(err) {
347
- const n = errName(err);
711
+ const n = errName2(err);
348
712
  return n === "AccessDeniedException" || n === "AccessDenied" || n === "UnauthorizedOperation" || n === "AuthorizationErrorException" || errStatus(err) === 403 && !/Throttl/.test(n);
349
713
  }
350
714
  var NOT_FOUND_ERRORS = /* @__PURE__ */ new Set(["ResourceNotFoundException", "PipelineNotFoundException", "InvalidArnException"]);
@@ -375,7 +739,7 @@ async function hintedTag(deps, account, hint) {
375
739
  try {
376
740
  return await readPipelineIdTag(deps.codepipeline(hint.region), resourceArn) ?? null;
377
741
  } catch (err) {
378
- if (NOT_FOUND_ERRORS.has(errName(err))) return void 0;
742
+ if (NOT_FOUND_ERRORS.has(errName2(err))) return void 0;
379
743
  throw err;
380
744
  }
381
745
  }
@@ -405,7 +769,7 @@ var LOOKUP_REFUSALS = {
405
769
  };
406
770
  function isFinal(r) {
407
771
  if (r.status >= 500) return false;
408
- return !("errorCode" in r.body && r.body.errorCode === "NOT_YET_VISIBLE");
772
+ return !("errorCode" in r.body && (r.body.errorCode === "NOT_YET_VISIBLE" || r.body.errorCode === "DEPLOY_BUSY"));
409
773
  }
410
774
  function createRunner(config, deps) {
411
775
  const jwks = config.runnerId ? new JwksCache(`${config.platformBaseUrl}${runnerJwksPath(config.runnerId)}`, deps.fetch, deps.now) : { get: async () => void 0 };
@@ -420,8 +784,8 @@ function createRunner(config, deps) {
420
784
  if (e?.pipelineName !== void 0 && e.pipelineName !== pipelineName) return fail("RUNNER_REFUSED");
421
785
  return { ...e?.status ? { executionStatus: e.status } : {} };
422
786
  } catch (err) {
423
- if (errName(err) === "PipelineNotFoundException") return fail("PIPELINE_NOT_FOUND");
424
- if (errName(err) === "PipelineExecutionNotFoundException") return fail("RUNNER_REFUSED");
787
+ if (errName2(err) === "PipelineNotFoundException") return fail("PIPELINE_NOT_FOUND");
788
+ if (errName2(err) === "PipelineExecutionNotFoundException") return fail("RUNNER_REFUSED");
425
789
  throw err;
426
790
  }
427
791
  }
@@ -435,7 +799,7 @@ function createRunner(config, deps) {
435
799
  }));
436
800
  return ok("started", out.pipelineExecutionId ? { executionId: out.pipelineExecutionId } : {});
437
801
  } catch (err) {
438
- if (errName(err) === "PipelineNotFoundException") return fail("PIPELINE_NOT_FOUND");
802
+ if (errName2(err) === "PipelineNotFoundException") return fail("PIPELINE_NOT_FOUND");
439
803
  throw err;
440
804
  }
441
805
  }
@@ -452,7 +816,7 @@ function createRunner(config, deps) {
452
816
  reason: `Stopped by pipeline-builder request ${claims.jti}`.slice(0, 200)
453
817
  }));
454
818
  } catch (err) {
455
- const n = errName(err);
819
+ const n = errName2(err);
456
820
  if (n === "DuplicatedStopRequestException") return ok("stopped", { executionId });
457
821
  if (n === "PipelineNotFoundException") return fail("PIPELINE_NOT_FOUND");
458
822
  if (n === "PipelineExecutionNotStoppableException" || n === "PipelineExecutionNotFoundException") return fail("RUNNER_REFUSED");
@@ -465,8 +829,28 @@ function createRunner(config, deps) {
465
829
  if (isResult(execution)) return execution;
466
830
  return ok("status", { executionId: claims.executionId, executionStatus: execution.executionStatus ?? "Unknown" });
467
831
  }
832
+ async function deployAction(claims) {
833
+ const answer = await runDeployAction({
834
+ runnerId: config.runnerId,
835
+ config: config.deploy,
836
+ codebuild: deps.codebuild(),
837
+ kms: deps.kms(),
838
+ isAllowed: (region, name) => isAllowed(config, region, name),
839
+ alreadyDeployed: async (pipelineId) => (await arnsByTag(config, deps, pipelineId)).length > 0
840
+ }, claims);
841
+ if ("refuse" in answer) return fail(answer.refuse);
842
+ const { outcome, ...details } = answer;
843
+ return ok(outcome, details);
844
+ }
468
845
  async function act(claims, account) {
469
- if (claims.action === "ping") return ok("pong", { regions: [...config.allowedRegions] });
846
+ if (claims.action === "ping") {
847
+ return ok("pong", {
848
+ regions: [...config.allowedRegions],
849
+ capabilities: config.deploy.enabled ? [DEPLOY_CAPABILITY] : [],
850
+ pipelinePrefixes: [...config.allowedPrefixes]
851
+ });
852
+ }
853
+ if (Object.hasOwn(DEPLOY_ACTION_CAPABILITY, claims.action)) return deployAction(claims);
470
854
  const found = await findPipeline(config, deps, account, claims.pipelineId, claims.hint);
471
855
  if (claims.action === "probe") {
472
856
  if (found.kind === "ambiguous") return fail("AMBIGUOUS_PIPELINE");
@@ -492,7 +876,7 @@ function createRunner(config, deps) {
492
876
  deps.log("ERROR", "Could not fetch the platform signing keys", { reason: err.message });
493
877
  return internal();
494
878
  }
495
- deps.log("ERROR", "Unexpected verification failure", { error: errName(err) || "Error" });
879
+ deps.log("ERROR", "Unexpected verification failure", { error: errName2(err) || "Error" });
496
880
  return internal();
497
881
  }
498
882
  const prior = replay.claim(claims.jti);
@@ -506,17 +890,24 @@ function createRunner(config, deps) {
506
890
  result = await act(claims, opts.account);
507
891
  } catch (err) {
508
892
  if (isAccessDenied(err)) {
509
- deps.log("ERROR", "The runner role was refused by AWS \u2014 redeploy the runner stack or fix its role", { ...logCtx, error: errName(err) });
893
+ deps.log("ERROR", "The runner role was refused by AWS \u2014 redeploy the runner stack or fix its role", { ...logCtx, error: errName2(err) });
510
894
  result = fail("RUNNER_PERMISSION_DENIED");
511
895
  } else {
512
- deps.log("ERROR", "Request failed", { ...logCtx, error: errName(err) || "Error" });
896
+ deps.log("ERROR", "Request failed", { ...logCtx, error: errName2(err) || "Error" });
513
897
  result = internal();
514
898
  }
515
899
  }
516
900
  if (isFinal(result)) replay.complete(claims.jti, result);
517
901
  else replay.forget(claims.jti);
518
902
  const b = result.body;
519
- deps.log("INFO", "Request handled", { ...logCtx, status: result.status, outcome: b.outcome ?? b.errorCode, ...b.executionId ? { executionId: b.executionId } : {} });
903
+ deps.log("INFO", "Request handled", {
904
+ ...logCtx,
905
+ status: result.status,
906
+ outcome: b.outcome ?? b.errorCode,
907
+ ...b.executionId ? { executionId: b.executionId } : {},
908
+ // `<project>:<uuid>` — no account id. The grant and its ciphertext are never logged.
909
+ ...b.buildId ? { buildId: b.buildId } : {}
910
+ });
520
911
  return result;
521
912
  }
522
913
  async function handleHttp(event, account) {
@@ -84,6 +84,14 @@ export declare function verifyRunRequest(jws: string, opts: {
84
84
  runnerId?: string;
85
85
  now: () => number;
86
86
  }): Promise<RunClaims>;
87
+ /** A CodePipeline name (what the runner's prefix allowlist is matched against). */
88
+ export declare const PIPELINE_NAME_PATTERN: RegExp;
89
+ /** A CloudFormation stack name. */
90
+ export declare const STACK_NAME_PATTERN: RegExp;
91
+ /** A managed toolchain release version (semver-like; it rides into a CodeBuild env override). */
92
+ export declare const TOOLCHAIN_RELEASE_PATTERN: RegExp;
93
+ /** A CodeBuild build id: `<project>:<uuid>` (no account id, no ARN). */
94
+ export declare const BUILD_ID_PATTERN: RegExp;
87
95
  /** A remembered request: its final result once known. */
88
96
  interface Seen<R> {
89
97
  firstSeenAt: number;
@@ -1 +1 @@
1
- {"version":3,"file":"runner-jws.d.ts","sources":["../../src/lambda/runner-jws.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACtF,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,6CAA6C,CAAC;AAErD,gEAAgE;AAChE,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,wEAAwE;AACxE,eAAO,MAAM,WAAW,QAAiB,CAAC;AAC1C,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,QAAY,CAAC;AAC7C,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,QAAiB,CAAC;AAE/C,6EAA6E;AAC7E,qBAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,MAAM,EAAE,MAAM,EAGzB;CACF;AAED,wGAAwG;AACxG,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,MAAM,EAAE,MAAM,EAGzB;CACF;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAA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