Skip to content

API reference

A runner set: one deployment of GitHub Actions runners that run on AWS Lambda MicroVMs, with a fresh VM per job that is thrown away when the job ends.

The construct deploys a webhook handler for GitHub’s workflow_job deliveries, a queue those deliveries become launch and terminate intents on, a launcher that starts a VM and registers it with GitHub for each queued job, and a janitor that sweeps on a schedule for VMs and runners that outlived their job. Every runner class registered through addRunnerClass adds an image build of its own, and a runner set needs at least one class to synthesize.

Deploying it takes two props: how to authenticate to GitHub, and which GitHub scope the runners register into. The VMs themselves carry no AWS identity unless GithubMicrovmRunnersProps.vmExecutionRole gives them one.

Example

const runnerSet = new GithubMicrovmRunners(stack, 'Runners', {
github: GithubAuth.app({
appId: GithubAppId.fromSecret(
Secret.fromSecretNameV2(stack, 'AppId', 'microvm-runner/dev/app-id'),
),
privateKey: GithubAppKey.fromSecret(
Secret.fromSecretNameV2(stack, 'AppKey', 'microvm-runner/dev/app-private-key'),
),
webhookSecret: Secret.fromSecretNameV2(
stack, 'WebhookSecret', 'microvm-runner/dev/webhook-secret',
),
}),
scope: RunnerScope.org('my-org'),
});
runnerSet.addRunnerClass('microvm', { size: MicrovmSize.GB4 });
import { GithubMicrovmRunners } from 'cdk-github-microvm-runners'
new GithubMicrovmRunners(scope: Construct, id: string, props: GithubMicrovmRunnersProps)
NameTypeDescription
scopeconstructs.ConstructNo description.
idstringNo description.
propsGithubMicrovmRunnersPropsNo description.

  • Type: constructs.Construct

  • Type: string


NameDescription
toStringReturns a string representation of this construct.
withApplies one or more mixins to this construct.
addRunnerClassRegister a runner class: the runs-on label a workflow targets, paired with the VM size, and optionally the image, that jobs carrying that label run on.
runnerClassThe registered RunnerClass carrying label.

public toString(): string

Returns a string representation of this construct.

public with(mixins: ...IMixin[]): IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

  • Type: …constructs.IMixin[]

The mixins to apply.


public addRunnerClass(label: string, props: RunnerClassProps): RunnerClass

Register a runner class: the runs-on label a workflow targets, paired with the VM size, and optionally the image, that jobs carrying that label run on.

Each class builds its own image. A runner set needs at least one class, and one that reaches synth with none fails.

Classes can be registered at any point before synth. Everything that depends on the full set of them — which labels the webhook accepts, which image each label launches, and the janitor’s access to each class’s image — is resolved once, after the last call.

Setting warmPoolSize on a class keeps that many pre-booted VMs ready for it. The first class to do so creates the warm-pool handler and its schedule, which every later warm class then shares.

  • Type: string

the runs-on label workflows use to target this class.


the VM size, and optionally the image, warm pool size, and idle policy for this class.


public runnerClass(label: string): RunnerClass

The registered RunnerClass carrying label.

Throws when no class with that label has been registered.

  • Type: string

the runs-on label the class was registered under.


NameDescription
isConstructChecks if x is a construct.

import { GithubMicrovmRunners } from 'cdk-github-microvm-runners'
GithubMicrovmRunners.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

  • Type: any

Any object.


NameTypeDescription
nodeconstructs.NodeThe tree node.
deadLetterQueueaws-cdk-lib.aws_sqs.IQueueDead-letter queue holding job-queue messages that ran out of redrives.
defaultImageArnstringThe image a job whose labels match no registered runner class launches on: the class labelled microvm if one is registered, otherwise the first class registered.
janitorFunctionaws-cdk-lib.aws_lambda.IFunctionThe janitor Lambda, which runs the scheduled sweep.
jobQueueaws-cdk-lib.aws_sqs.IQueueQueue carrying launch and terminate intents from the webhook handler to the launcher.
launcherFunctionaws-cdk-lib.aws_lambda.IFunctionThe launcher Lambda, which reads the job queue and starts and terminates MicroVMs.
metricsGithubMicrovmRunnersMetricsThis runner set’s CloudWatch metrics and the ready-made alarms over them.
runnerClassesRunnerClass[]Every runner class registered through addRunnerClass, in the order they were registered.
runnerTableaws-cdk-lib.aws_dynamodb.ITableDynamoDB table mapping each runner’s name to its MicroVM, and holding the janitor’s record of which VMs it already suspects.
setupCommandstringThe command that creates this runner set’s GitHub App and writes its three secrets.
webhookFunctionaws-cdk-lib.aws_lambda.IFunctionThe webhook Lambda, which GitHub’s deliveries reach through webhookUrl.
webhookUrlstringThe webhook handler’s public Function URL, which is the payload URL to configure on the GitHub App or webhook.
vmConsoleLogGroupaws-cdk-lib.aws_logs.ILogGroupWhere a VM’s runtime console goes when console capture is on: the group the construct created, or the one you supplied.
vmExecutionRoleaws-cdk-lib.aws_iam.IRoleThe AWS identity launched MicroVMs run with, passed in as GithubMicrovmRunnersProps.vmExecutionRole, or undefined when the VMs carry no AWS identity. Console capture runs on this role and requires it. A runner set identifies its own VMs by the image they booted from, not by this role.
warmPoolFunctionaws-cdk-lib.aws_lambda.IFunctionThe Lambda that refills the warm pool, or undefined when no registered runner class sets RunnerClassProps.warmPoolSize. It is created by the first class that does, so a runner set with no warm class deploys neither this function nor its schedule.

public readonly node: Node;
  • Type: constructs.Node

The tree node.


public readonly deadLetterQueue: IQueue;
  • Type: aws-cdk-lib.aws_sqs.IQueue

Dead-letter queue holding job-queue messages that ran out of redrives.


public readonly defaultImageArn: string;
  • Type: string

The image a job whose labels match no registered runner class launches on: the class labelled microvm if one is registered, otherwise the first class registered.

Runner classes can be added right up until synth, so this is a token that resolves once the set of them is final.


public readonly janitorFunction: IFunction;
  • Type: aws-cdk-lib.aws_lambda.IFunction

The janitor Lambda, which runs the scheduled sweep.


public readonly jobQueue: IQueue;
  • Type: aws-cdk-lib.aws_sqs.IQueue

Queue carrying launch and terminate intents from the webhook handler to the launcher.


public readonly launcherFunction: IFunction;
  • Type: aws-cdk-lib.aws_lambda.IFunction

The launcher Lambda, which reads the job queue and starts and terminates MicroVMs.


public readonly metrics: GithubMicrovmRunnersMetrics;

This runner set’s CloudWatch metrics and the ready-made alarms over them.


public readonly runnerClasses: RunnerClass[];

Every runner class registered through addRunnerClass, in the order they were registered.

It is empty until the first class is added, and a runner set that reaches synth with none fails. Each call returns a copy, so changing the returned array does not change the runner set.


public readonly runnerTable: ITable;
  • Type: aws-cdk-lib.aws_dynamodb.ITable

DynamoDB table mapping each runner’s name to its MicroVM, and holding the janitor’s record of which VMs it already suspects.


public readonly setupCommand: string;
  • Type: string

The command that creates this runner set’s GitHub App and writes its three secrets.

It carries the scope, the stack name, and the region this runner set was built with, and is pinned to the version of this library that produced it, so the helper and the construct agree about secret names and stack outputs.

Surface it as a stack output and the deploy ends by printing the line to paste. On a stack built without an explicit env, the region is a token that reads as ${Token[AWS.Region.N]} here and resolves to the real region in the deployed output.


Example

new cdk.CfnOutput(stack, 'SetupCommand', { value: runners.setupCommand });
public readonly webhookFunction: IFunction;
  • Type: aws-cdk-lib.aws_lambda.IFunction

The webhook Lambda, which GitHub’s deliveries reach through webhookUrl.


public readonly webhookUrl: string;
  • Type: string

The webhook handler’s public Function URL, which is the payload URL to configure on the GitHub App or webhook.


public readonly vmConsoleLogGroup: ILogGroup;
  • Type: aws-cdk-lib.aws_logs.ILogGroup

Where a VM’s runtime console goes when console capture is on: the group the construct created, or the one you supplied.

undefined when console capture is off.


public readonly vmExecutionRole: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole

The AWS identity launched MicroVMs run with, passed in as GithubMicrovmRunnersProps.vmExecutionRole, or undefined when the VMs carry no AWS identity. Console capture runs on this role and requires it. A runner set identifies its own VMs by the image they booted from, not by this role.


public readonly warmPoolFunction: IFunction;
  • Type: aws-cdk-lib.aws_lambda.IFunction

The Lambda that refills the warm pool, or undefined when no registered runner class sets RunnerClassProps.warmPoolSize. It is created by the first class that does, so a runner set with no warm class deploys neither this function nor its schedule.


The build behind one runner class’s MicroVM image.

addRunnerClass creates one for each class it registers and returns it as RunnerClass.imagePipeline, so this is a handle you read rather than a construct you instantiate.

It stages the class’s Dockerfile and build context as a CDK asset, declares the AWS::Lambda::MicrovmImage resource that CloudFormation builds from it, and creates the IAM role that build runs as. Reading it is how you reach the built image’s name and ARN, and the role the build runs as.

Example

const buildClass = runners.addRunnerClass('build', {
size: MicrovmSize.GB4,
image: RunnerImage.fromOptions({ systemPackages: ['jq'] }),
});
new cdk.CfnOutput(stack, 'BuildImageName', {
value: buildClass.imagePipeline.imageName,
});
import { ImagePipeline } from 'cdk-github-microvm-runners'
new ImagePipeline(scope: Construct, id: string, props: ImagePipelineProps)
NameTypeDescription
scopeconstructs.ConstructNo description.
idstringNo description.
propsImagePipelinePropsNo description.

  • Type: constructs.Construct

  • Type: string


NameDescription
toStringReturns a string representation of this construct.
withApplies one or more mixins to this construct.

public toString(): string

Returns a string representation of this construct.

public with(mixins: ...IMixin[]): IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

  • Type: …constructs.IMixin[]

The mixins to apply.


NameDescription
isConstructChecks if x is a construct.

import { ImagePipeline } from 'cdk-github-microvm-runners'
ImagePipeline.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

  • Type: any

Any object.


NameTypeDescription
nodeconstructs.NodeThe tree node.
buildRoleaws-cdk-lib.aws_iam.IRoleIAM role the image build runs as, able to read the staged build context and pull any private container base image.
imageArnstringARN of the built MicroVM image.
imageNamestringName of the built MicroVM image — the per-class runnerSetId, stable for the life of the runner class.
imageResourceaws-cdk-lib.aws_lambda.CfnMicrovmImageThe underlying AWS::Lambda::MicrovmImage resource.
imageVersionstringThe image’s latest active version, which advances every time the image is rebuilt in place.

public readonly node: Node;
  • Type: constructs.Node

The tree node.


public readonly buildRole: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole

IAM role the image build runs as, able to read the staged build context and pull any private container base image.


public readonly imageArn: string;
  • Type: string

ARN of the built MicroVM image.


public readonly imageName: string;
  • Type: string

Name of the built MicroVM image — the per-class runnerSetId, stable for the life of the runner class.


public readonly imageResource: CfnMicrovmImage;
  • Type: aws-cdk-lib.aws_lambda.CfnMicrovmImage

The underlying AWS::Lambda::MicrovmImage resource.


public readonly imageVersion: string;
  • Type: string

The image’s latest active version, which advances every time the image is rebuilt in place.


Props for GithubAuth.app.

import { GithubAppAuthProps } from 'cdk-github-microvm-runners'
const githubAppAuthProps: GithubAppAuthProps = { ... }
NameTypeDescription
appIdGithubAppIdThe GitHub App’s numeric ID, as a literal or a Secrets Manager reference.
privateKeyGithubAppKeyThe App’s private key, backed by a secret or a KMS key.
webhookSecretaws-cdk-lib.aws_secretsmanager.ISecretSecret holding the webhook secret used to validate inbound deliveries.

public readonly appId: GithubAppId;

The GitHub App’s numeric ID, as a literal or a Secrets Manager reference.


public readonly privateKey: GithubAppKey;

The App’s private key, backed by a secret or a KMS key.


public readonly webhookSecret: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

Secret holding the webhook secret used to validate inbound deliveries.


Props for GithubMicrovmRunners.

import { GithubMicrovmRunnersProps } from 'cdk-github-microvm-runners'
const githubMicrovmRunnersProps: GithubMicrovmRunnersProps = { ... }
NameTypeDescription
githubGithubAuthHow the runner set authenticates to GitHub, as an App or with a personal access token.
scopeRunnerScopeWhich GitHub scope, an organization or a list of repositories, registered runners are visible to.
additionalRegionsstring[]Additional regions to accept as Lambda MicroVMs regions, beyond the ones this library already knows about.
consoleLogsConsoleLogsWhere a VM’s runtime console goes: everything it prints while it boots, runs the runner agent, and runs the job.
deadLetterRetentionaws-cdk-lib.DurationHow long the dead-letter queue retains a failed launch or terminate intent.
emitMetricsbooleanReport this runner set’s CloudWatch custom metrics.
encryptionKeyaws-cdk-lib.aws_kms.IKeyCustomer-managed KMS key for this runner set’s data at rest: the DynamoDB runner table, the SQS job queue and dead-letter queue, and any log group this construct creates.
idleRunnerGraceSecondsnumberHow many seconds a registered runner may sit idle before the janitor’s two-strike sweep treats it as stuck.
imageLogsImageLogsWhere build-time image logs go: the Docker build layers and the ready-probe banner from each image build.
janitorIntervalaws-cdk-lib.DurationHow often the janitor sweep runs.
keepImageVersionsnumberHow many MicroVM image versions to keep per runner class.
lambdaMemorySizenumberMemory, in MiB, for the handler Lambdas: the webhook, the launcher, the janitor, and the warm pool.
logRetentionaws-cdk-lib.aws_logs.RetentionDaysRetention for the CloudWatch log groups this construct creates: the handler Lambda log groups and, when console capture is on, the VM console group.
maxConcurrentVmsnumberMaximum number of MicroVMs this runner set runs at once.
maxJobDurationaws-cdk-lib.DurationHow long a job may run before its MicroVM is terminated.
maxReceiveCountnumberHow many times a launch intent is redriven before it dead-letters.
networkRunnerNetworkHow launched MicroVMs and image builds reach the network.
permissionsBoundaryaws-cdk-lib.aws_iam.IManagedPolicyPermissions boundary applied to every IAM role this construct creates: the handler execution roles, the per-class image build roles, and the network-connector operator role.
pointInTimeRecoverybooleanTurn on DynamoDB point-in-time recovery for the runner table.
recoverStuckLaunchesbooleanRe-launch jobs that are still waiting for a runner they never got.
removalPolicyaws-cdk-lib.RemovalPolicyRemoval policy for this runner set’s stateful resources: the runner table and any log group the construct creates.
vmExecutionRoleaws-cdk-lib.aws_iam.IRoleAn AWS identity for this runner set’s runner VMs.
warmPoolIntervalaws-cdk-lib.DurationHow often the warm-pool sweep refills pre-booted VMs.
webhookWebhookEndpointHow the webhook handler is exposed to GitHub.
webhookReservedConcurrencynumberReserved concurrency for the webhook Lambda, which caps how many webhook deliveries the runner set processes at once.

public readonly github: GithubAuth;

How the runner set authenticates to GitHub, as an App or with a personal access token.

This also carries the webhook secret.


public readonly scope: RunnerScope;

Which GitHub scope, an organization or a list of repositories, registered runners are visible to.


public readonly additionalRegions: string[];
  • Type: string[]
  • Default: [] (only the regions this library knows about)

Additional regions to accept as Lambda MicroVMs regions, beyond the ones this library already knows about.

Deploying into a region on neither list fails at synth.


public readonly consoleLogs: ConsoleLogs;
  • Type: ConsoleLogs
  • Default: undefined (no runtime console capture)

Where a VM’s runtime console goes: everything it prints while it boots, runs the runner agent, and runs the job.

ConsoleLogs.enabled() has the construct create the group and expose it as vmConsoleLogGroup, and ConsoleLogs.enabled(logGroup) uses one you control. The platform writes these logs with the VM’s own role, so this requires vmExecutionRole; see ConsoleLogs for what that role means for job code. Independent of imageLogs.


public readonly deadLetterRetention: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: Duration.days(4) (SQS default)

How long the dead-letter queue retains a failed launch or terminate intent.

SQS allows up to 14 days, which is also how long recoverStuckLaunches has to re-drive a message before SQS drops it.


public readonly emitMetrics: boolean;
  • Type: boolean
  • Default: false (no metrics emitted)

Report this runner set’s CloudWatch custom metrics.

Those are the janitor’s per-sweep counters, the launcher’s per-launch outcomes and spin-up timings, and the warm pool’s fill numbers — everything GithubMicrovmRunnersMetrics names. With this off the handlers report none of them.

CloudWatch bills custom metrics per metric per month, and this runner set’s bill is not a fixed number: the launcher and warm-pool metrics carry a runner-class dimension, so each one becomes a separate billable metric per registered runner class.

The two alarms backed by these metrics, sweepErrorsAlarm and stuckLaunchesRecoveredAlarm, throw at synth unless this is on, since the metric they watch would never report. deadLetterQueueNotEmptyAlarm watches an SQS metric and works either way. The metric accessors on GithubMicrovmRunnersMetrics return a Metric regardless, so a dashboard can be built ahead of turning metrics on.


public readonly encryptionKey: IKey;
  • Type: aws-cdk-lib.aws_kms.IKey
  • Default: undefined (AWS-managed keys)

Customer-managed KMS key for this runner set’s data at rest: the DynamoDB runner table, the SQS job queue and dead-letter queue, and any log group this construct creates.

Log groups you bring yourself, and the GitHub secrets you pass in, keep their own keys.


public readonly idleRunnerGraceSeconds: number;
  • Type: number
  • Default: 600

How many seconds a registered runner may sit idle before the janitor’s two-strike sweep treats it as stuck.


public readonly imageLogs: ImageLogs;
  • Type: ImageLogs
  • Default: undefined (no image logs)

Where build-time image logs go: the Docker build layers and the ready-probe banner from each image build.

ImageLogs.enabled() sends them to the platform’s own CloudWatch group, and ImageLogs.enabled(logGroup) to a group whose retention and KMS key you control. These are written by the image build role rather than by a VM, so they need no VM execution role. Independent of consoleLogs.


public readonly janitorInterval: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: Duration.minutes(5)

How often the janitor sweep runs.


public readonly keepImageVersions: number;
  • Type: number
  • Default: 5

How many MicroVM image versions to keep per runner class.

The janitor prunes inactive versions past this count.


public readonly lambdaMemorySize: number;
  • Type: number
  • Default: 128

Memory, in MiB, for the handler Lambdas: the webhook, the launcher, the janitor, and the warm pool.

The janitor’s sweep scans the runner table and reconciles every running VM, so it is the handler most sensitive to this on a busy runner set.


public readonly logRetention: RetentionDays;
  • Type: aws-cdk-lib.aws_logs.RetentionDays
  • Default: logs.RetentionDays.TWO_WEEKS

Retention for the CloudWatch log groups this construct creates: the handler Lambda log groups and, when console capture is on, the VM console group.


public readonly maxConcurrentVms: number;
  • Type: number
  • Default: 10

Maximum number of MicroVMs this runner set runs at once.


public readonly maxJobDuration: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: Duration.hours(6)

How long a job may run before its MicroVM is terminated.

The VM is killed five minutes after this value, not at it. The runner set asks the platform for maxJobDuration + 5 minutes, so that a job which reaches its own limit is stopped by the runner — which reports the timeout to GitHub and lets the VM come down cleanly — rather than by the platform removing the machine underneath it. Treat the five minutes as headroom for that shutdown rather than as extra running time.


public readonly maxReceiveCount: number;
  • Type: number
  • Default: 20

How many times a launch intent is redriven before it dead-letters.

A runner set already at maxConcurrentVms redrives capacity-rejected launches through this same budget, so on a runner set that regularly runs at capacity this count is how long a queued job waits before its launch is dropped. See docs/service-quotas.md.


public readonly network: RunnerNetwork;

How launched MicroVMs and image builds reach the network.


public readonly permissionsBoundary: IManagedPolicy;
  • Type: aws-cdk-lib.aws_iam.IManagedPolicy
  • Default: undefined (no boundary)

Permissions boundary applied to every IAM role this construct creates: the handler execution roles, the per-class image build roles, and the network-connector operator role.

It is applied once at construct scope, so roles created later also carry it — the warm-pool handler’s role, and the build role of any runner class registered after construction.


public readonly pointInTimeRecovery: boolean;
  • Type: boolean
  • Default: false

Turn on DynamoDB point-in-time recovery for the runner table.


public readonly recoverStuckLaunches: boolean;
  • Type: boolean
  • Default: true

Re-launch jobs that are still waiting for a runner they never got.

This is the floor under an event-driven plane, and it is on by default.

GitHub announces a job once. If the launch that announcement triggered doesn’t end with the job being served, nothing else ever asks again, and the job waits for as long as the workflow allows with no error anywhere — the plane looks healthy because by its own bookkeeping it did its work. Each janitor sweep closes that hole from two directions: it re-drives dead-lettered launch messages back onto the job queue, and it re-launches claims whose VM is gone while the job is still queued. Both check with GitHub first, so a job that has since completed or been cancelled is discarded rather than booting a VM for work nobody is waiting on.

Turn it off only if you want a job that slips through to stay stuck. The cost of leaving it on is one extra GitHub read per sweep per candidate, bounded per sweep so it cannot exhaust the installation’s rate limit.

The janitor counts recoveries under the stuckLaunchesRecovered and stuckClaimsRelaunched metrics, which report when emitMetrics is on. A count that stays high means launches are failing for some ongoing reason and the recovery is masking it — alarm on it rather than ignoring it.


public readonly removalPolicy: RemovalPolicy;
  • Type: aws-cdk-lib.RemovalPolicy
  • Default: RemovalPolicy.DESTROY

Removal policy for this runner set’s stateful resources: the runner table and any log group the construct creates.

The table holds correlation data for VMs that are currently running, all of which the janitor can rebuild from the MicroVM and GitHub APIs.


public readonly vmExecutionRole: IRole;
  • Type: aws-cdk-lib.aws_iam.IRole
  • Default: undefined (the VMs carry no AWS identity)

An AWS identity for this runner set’s runner VMs.

By default the VMs carry no AWS identity at all: the runner agent talks outbound to GitHub, the just-in-time registration is pushed to the VM over a platform-authenticated channel, and a job that needs AWS assumes its own role through GitHub OIDC.

With a role attached, the MicroVM’s instance metadata service serves that role’s credentials to arbitrary job code, so every job running on this runner set can do whatever the role can do. consoleLogs requires a role, because the platform writes a VM’s console output using it.


public readonly warmPoolInterval: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: Duration.minutes(2)

How often the warm-pool sweep refills pre-booted VMs.

It applies only to runner classes that set RunnerClassProps.warmPoolSize, and the warm-pool handler and its schedule are only created once such a class is registered. A runner set with no warm class never runs this sweep, and never reads this value.


public readonly webhook: WebhookEndpoint;

How the webhook handler is exposed to GitHub.


public readonly webhookReservedConcurrency: number;
  • Type: number
  • Default: undefined (no reservation; the webhook draws from the shared pool)

Reserved concurrency for the webhook Lambda, which caps how many webhook deliveries the runner set processes at once.

Reserved concurrency is carved out of the account’s shared pool of unreserved concurrency, so a runner set that sets it takes that capacity away from every other function in the account. Must be a positive integer when set, since 0 would disable the webhook entirely.


Props for GithubAuth.pat.

import { GithubPatAuthProps } from 'cdk-github-microvm-runners'
const githubPatAuthProps: GithubPatAuthProps = { ... }
NameTypeDescription
tokenaws-cdk-lib.aws_secretsmanager.ISecretSecret holding a GitHub personal access token.
webhookSecretaws-cdk-lib.aws_secretsmanager.ISecretSecret holding the webhook secret used to validate inbound deliveries.

public readonly token: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

Secret holding a GitHub personal access token.


public readonly webhookSecret: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

Secret holding the webhook secret used to validate inbound deliveries.


One extra file or directory baked into the image.

source is a path on the machine running cdk synth. The image pipeline reads it off disk when it stages the Docker build context, and the rendered Dockerfile copies it to target inside the image.

import { ImageAsset } from 'cdk-github-microvm-runners'
const imageAsset: ImageAsset = { ... }
NameTypeDescription
sourcestringPath (file or directory) on the build machine to copy into the image.
targetstringAbsolute path inside the image to copy source to.

public readonly source: string;
  • Type: string

Path (file or directory) on the build machine to copy into the image.


public readonly target: string;
  • Type: string

Absolute path inside the image to copy source to.


Props for ImagePipeline.

import { ImagePipelineProps } from 'cdk-github-microvm-runners'
const imagePipelineProps: ImagePipelineProps = { ... }
NameTypeDescription
imageRunnerImageThe runner image to build: RunnerImage.fromOptions() for a synthesized Dockerfile, RunnerImage.fromInline(text) for Dockerfile text, or RunnerImage.fromDockerfile(dir) for a Dockerfile and build context on disk.
networkRunnerNetworkHow the build and the VMs reach the network.
runnerSetIdstringIdentifier for the runner set this image belongs to, used verbatim as the image’s name.
sizeMicrovmSizeThe size the built image runs at, which becomes its memory floor.
baseImageVersionstringVersion of the managed al2023-1 base image to build from.
imageLogsImageLogsWhere the build’s logs go.
readyTimeoutSecondsnumberSeconds the service waits for the in-VM agent’s /ready hook before failing the image build.
runTimeoutSecondsnumberSeconds the service waits for the in-VM agent’s /run hook to accept a launch.

public readonly image: RunnerImage;

The runner image to build: RunnerImage.fromOptions() for a synthesized Dockerfile, RunnerImage.fromInline(text) for Dockerfile text, or RunnerImage.fromDockerfile(dir) for a Dockerfile and build context on disk.


public readonly network: RunnerNetwork;

How the build and the VMs reach the network.


public readonly runnerSetId: string;
  • Type: string

Identifier for the runner set this image belongs to, used verbatim as the image’s name.

It is deliberately stable: the name is the only property whose change forces CloudFormation to replace the image, so holding it still keeps every content change an in-place update that adds a version. A content change is still picked up — the build context is a content-hashed CDK asset, so it moves codeArtifact — and an unchanged one is still a no-op. Must match ^[a-zA-Z0-9-_]+$ and be 64 characters or fewer, the service’s name limit.


public readonly size: MicrovmSize;

The size the built image runs at, which becomes its memory floor.


public readonly baseImageVersion: string;
  • Type: string
  • Default: ‘0’

Version of the managed al2023-1 base image to build from.


public readonly imageLogs: ImageLogs;

Where the build’s logs go.

Left unset, the build emits no logs; ImageLogs.enabled() sends them to the platform’s group, and ImageLogs.enabled(logGroup) to a group you supply.


public readonly readyTimeoutSeconds: number;
  • Type: number
  • Default: 300

Seconds the service waits for the in-VM agent’s /ready hook before failing the image build.


public readonly runTimeoutSeconds: number;
  • Type: number
  • Default: 60

Seconds the service waits for the in-VM agent’s /run hook to accept a launch.

Service maximum: 60.


When the platform suspends and resumes a runner class’s cold-launched VMs.

This mirrors the MicroVM service’s own idlePolicy shape, expressed as Durations rather than raw seconds. Set it on a runner class through RunnerClassProps.idlePolicy.

import { MicrovmIdlePolicy } from 'cdk-github-microvm-runners'
const microvmIdlePolicy: MicrovmIdlePolicy = { ... }
NameTypeDescription
maxIdleDurationaws-cdk-lib.DurationIdle time before the platform auto-suspends the VM.
suspendedDurationaws-cdk-lib.DurationHow long a suspended VM is kept before the platform terminates it.
autoResumebooleanAuto-resume the VM on activity.

public readonly maxIdleDuration: Duration;
  • Type: aws-cdk-lib.Duration

Idle time before the platform auto-suspends the VM.


public readonly suspendedDuration: Duration;
  • Type: aws-cdk-lib.Duration

How long a suspended VM is kept before the platform terminates it.

Required. The MicroVM service rejects a launch whose idle policy omits this value, and it offers no value meaning “keep the suspended VM indefinitely”, so every idle policy names a duration.


public readonly autoResume: boolean;
  • Type: boolean
  • Default: false

Auto-resume the VM on activity.


Tuning for the ready-made alarms on GithubMicrovmRunnersMetrics.

import { RunnerAlarmOptions } from 'cdk-github-microvm-runners'
const runnerAlarmOptions: RunnerAlarmOptions = { ... }
NameTypeDescription
evaluationPeriodsnumberConsecutive breaching periods before the alarm fires.
periodaws-cdk-lib.DurationAggregation period for the metric.
thresholdnumberValue at or above which the alarm fires.

public readonly evaluationPeriods: number;
  • Type: number
  • Default: 1 (3 for the stuck-launch alarm)

Consecutive breaching periods before the alarm fires.


public readonly period: Duration;
  • Type: aws-cdk-lib.Duration
  • Default: Duration.minutes(5)

Aggregation period for the metric.


public readonly threshold: number;
  • Type: number
  • Default: 1

Value at or above which the alarm fires.


Handle returned by GithubMicrovmRunners.addRunnerClass.

import { RunnerClass } from 'cdk-github-microvm-runners'
const runnerClass: RunnerClass = { ... }
NameTypeDescription
imageArnstringARN of this class’s built MicroVM image (a CloudFormation token at synth).
imagePipelineImagePipelineThe image pipeline that builds and publishes this class’s MicroVM image.
labelstringThe runs-on label workflows target to run on this class.
sizeMicrovmSizeThe VM memory floor this class launches at.

public readonly imageArn: string;
  • Type: string

ARN of this class’s built MicroVM image (a CloudFormation token at synth).


public readonly imagePipeline: ImagePipeline;

The image pipeline that builds and publishes this class’s MicroVM image.


public readonly label: string;
  • Type: string

The runs-on label workflows target to run on this class.


public readonly size: MicrovmSize;

The VM memory floor this class launches at.


Props for GithubMicrovmRunners.addRunnerClass.

import { RunnerClassProps } from 'cdk-github-microvm-runners'
const runnerClassProps: RunnerClassProps = { ... }
NameTypeDescription
sizeMicrovmSizeVM memory floor for this class.
idlePolicyMicrovmIdlePolicyAuto-suspend and auto-resume policy for this class’s cold-launched VMs.
imageRunnerImageImage this class builds from.
warmPoolSizenumberHow many pre-booted, suspended VMs to keep ready for this class.

public readonly size: MicrovmSize;

VM memory floor for this class.


public readonly idlePolicy: MicrovmIdlePolicy;
  • Type: MicrovmIdlePolicy
  • Default: undefined (no idle policy; the platform never auto-suspends)

Auto-suspend and auto-resume policy for this class’s cold-launched VMs.

Mutually exclusive with warmPoolSize on the same class, since both drive the VM’s suspended state; setting both throws at addRunnerClass time.


public readonly image: RunnerImage;

Image this class builds from.


public readonly warmPoolSize: number;
  • Type: number
  • Default: undefined (no warm pool; every job cold-launches)

How many pre-booted, suspended VMs to keep ready for this class.

A job that matches this class resumes one of them instead of cold-launching a new VM, and falls back to a cold launch when none is available. This is a count, not a flag: warmPoolSize: 3 keeps three VMs ready. The runner set refills the pool on the warmPoolInterval schedule.


Options for RunnerImage.fromOptions.

import { RunnerImageOptions } from 'cdk-github-microvm-runners'
const runnerImageOptions: RunnerImageOptions = { ... }
NameTypeDescription
additionalOsCapabilitiesstring[]Extra Linux capabilities granted to the MicroVM’s operating system.
assetsImageAsset[]Extra files and directories to copy into the image.
environment{[ key: string ]: string}Extra environment variables baked into the image.
runnerVersionRunnerVersionactions/runner release to install.
setupCommandsstring[]Extra RUN commands, executed in order after packages, assets, and environment variables are laid down.
systemPackagesstring[]Extra dnf packages to install alongside the fixed base set.
toolchainsRunnerToolchain[]Language runtimes to bake into the hosted tool cache, so actions/setup-* finds them without downloading anything.

public readonly additionalOsCapabilities: string[];
  • Type: string[]
  • Default: [‘ALL’]

Extra Linux capabilities granted to the MicroVM’s operating system.


public readonly assets: ImageAsset[];

Extra files and directories to copy into the image.


public readonly environment: {[ key: string ]: string};
  • Type: {[ key: string ]: string}

Extra environment variables baked into the image.


public readonly runnerVersion: RunnerVersion;

actions/runner release to install.


public readonly setupCommands: string[];
  • Type: string[]

Extra RUN commands, executed in order after packages, assets, and environment variables are laid down.


public readonly systemPackages: string[];
  • Type: string[]

Extra dnf packages to install alongside the fixed base set.


public readonly toolchains: RunnerToolchain[];

Language runtimes to bake into the hosted tool cache, so actions/setup-* finds them without downloading anything.

An image with none of these is smaller; one toolchain entry is needed per version your workflows ask for.


Options for RunnerNetwork.vpc.

import { RunnerNetworkVpcOptions } from 'cdk-github-microvm-runners'
const runnerNetworkVpcOptions: RunnerNetworkVpcOptions = { ... }
NameTypeDescription
securityGroupsaws-cdk-lib.aws_ec2.ISecurityGroup[]Security groups attached to the connector’s ENIs.
subnetsaws-cdk-lib.aws_ec2.SubnetSelectionWhich of the VPC’s subnets the connector’s ENIs land in.

public readonly securityGroups: ISecurityGroup[];
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]
  • Default: a new security group is created on the VPC

Security groups attached to the connector’s ENIs.


public readonly subnets: SubnetSelection;
  • Type: aws-cdk-lib.aws_ec2.SubnetSelection
  • Default: the VPC’s private-with-egress subnets (CDK’s selectSubnets() default; falls back to isolated, then public, subnets if the VPC has none of the preceding kind)

Which of the VPC’s subnets the connector’s ENIs land in.


Runtime console capture for a runner set: everything a VM prints while it boots, runs the runner agent, and runs the job.

Off unless you add it.

Console capture needs a VM execution role. The platform writes these logs with the VM’s own role, and the construct never creates a VM identity on your behalf, so a runner set that turns console capture on without vmExecutionRole fails at synth. The two console-write actions on the group are granted by you as well, since the construct does not add policy to a role it did not create:

runners.vmConsoleLogGroup!.grant(
role, 'logs:CreateLogStream', 'logs:PutLogEvents',
);

A MicroVM’s instance metadata service serves the execution role’s credentials to arbitrary job code, so whatever that role can do, every job running on this runner set can do. Console capture on its own needs nothing beyond the two log-write actions above. Job code can also write whatever it likes into the console group, so the contents are as trustworthy as the jobs that produced them.

ImageLogs covers the build-time counterpart and needs no role. The two are independent and can both be on.

Example

new GithubMicrovmRunners(stack, 'Runners', {
github,
scope,
vmExecutionRole: role,
consoleLogs: ConsoleLogs.enabled(),
});
NameDescription
enabledCapture the runtime console.

import { ConsoleLogs } from 'cdk-github-microvm-runners'
ConsoleLogs.enabled(logGroup?: ILogGroup)

Capture the runtime console.

With no argument the construct creates a log group and exposes it as runners.vmConsoleLogGroup. Pass an ILogGroup to use one whose retention and KMS key you control. Either way the runner set needs vmExecutionRole, and that role needs the two console-write actions on the group.

Example

const consoleCapture = ConsoleLogs.enabled(myConsoleLogGroup);
  • Type: aws-cdk-lib.aws_logs.ILogGroup

destination group.

Omitted, the construct creates one with the runner set’s logRetention (two weeks by default).


NameTypeDescription
logGroupaws-cdk-lib.aws_logs.ILogGroupThe group console output goes to, when one was passed to ConsoleLogs.enabled(). undefined means the construct creates one.

public readonly logGroup: ILogGroup;
  • Type: aws-cdk-lib.aws_logs.ILogGroup

The group console output goes to, when one was passed to ConsoleLogs.enabled(). undefined means the construct creates one.


Where a GitHub App’s numeric ID comes from: a literal known at synth time, or a Secrets Manager secret read at runtime.

The secret form makes setup single-pass. A GitHub App can only be created once the runner set’s webhook URL exists, so an App ID that has to be known at synth means deploying twice. Referencing the ID by secret, the way the private key and webhook secret already are, lets you deploy, then create the App and write its ID into the secret, with no redeploy.

Build one with the static factories below; the constructor is private.

Example

const appId = GithubAppId.fromSecret(
Secret.fromSecretNameV2(stack, 'AppId', 'microvm-runner/dev/app-id'),
);
NameDescription
fromSecretThe App ID is read at runtime from a Secrets Manager secret whose value is the numeric ID.
fromValueThe App ID is a literal string known at synth time.

import { GithubAppId } from 'cdk-github-microvm-runners'
GithubAppId.fromSecret(secret: ISecret)

The App ID is read at runtime from a Secrets Manager secret whose value is the numeric ID.

The secret need not exist at deploy time.

Example

const appId = GithubAppId.fromSecret(
Secret.fromSecretNameV2(stack, 'AppId', 'microvm-runner/dev/app-id'),
);
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

import { GithubAppId } from 'cdk-github-microvm-runners'
GithubAppId.fromValue(value: string)

The App ID is a literal string known at synth time.

Example

const appId = GithubAppId.fromValue('123456');
  • Type: string

NameTypeDescription
secretaws-cdk-lib.aws_secretsmanager.ISecretThe secret holding the ID, for an ID built with fromSecret().
valuestringThe literal ID, for an ID built with fromValue().

public readonly secret: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

The secret holding the ID, for an ID built with fromSecret().


public readonly value: string;
  • Type: string

The literal ID, for an ID built with fromValue().


Where a GitHub App’s private key lives: a Secrets Manager secret holding the PEM, or a KMS key that signs the App’s JWTs directly.

Build one with the static factories below; the constructor is private.

Example

const privateKey = GithubAppKey.fromSecret(
Secret.fromSecretNameV2(stack, 'AppKey', 'microvm-runner/dev/app-private-key'),
);
NameDescription
fromKmsKeyThe App’s private key lives in KMS and is used via kms:Sign.
fromSecretThe App’s private key is stored as a PEM in Secrets Manager.

import { GithubAppKey } from 'cdk-github-microvm-runners'
GithubAppKey.fromKmsKey(key: IKey)

The App’s private key lives in KMS and is used via kms:Sign.

Example

import { Key } from 'aws-cdk-lib/aws-kms';
const privateKey = GithubAppKey.fromKmsKey(
Key.fromKeyArn(
stack,
'AppKey',
'arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab',
),
);
  • Type: aws-cdk-lib.aws_kms.IKey

import { GithubAppKey } from 'cdk-github-microvm-runners'
GithubAppKey.fromSecret(secret: ISecret)

The App’s private key is stored as a PEM in Secrets Manager.

Example

const privateKey = GithubAppKey.fromSecret(
Secret.fromSecretNameV2(stack, 'AppKey', 'microvm-runner/dev/app-private-key'),
);
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

NameTypeDescription
kmsKeyaws-cdk-lib.aws_kms.IKeyThe signing key, for a key built with fromKmsKey().
secretaws-cdk-lib.aws_secretsmanager.ISecretThe secret holding the PEM, for a key built with fromSecret().

public readonly kmsKey: IKey;
  • Type: aws-cdk-lib.aws_kms.IKey

The signing key, for a key built with fromKmsKey().


public readonly secret: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

The secret holding the PEM, for a key built with fromSecret().


How a runner set authenticates to GitHub: as a GitHub App, whose private key is backed by a secret or a KMS key, or with a personal access token.

Either form also carries the webhook secret that inbound GitHub deliveries are validated against.

Build one with the static factories below; the constructor is private.

Example

const auth = GithubAuth.app({
appId: GithubAppId.fromSecret(
Secret.fromSecretNameV2(stack, 'AppId', 'microvm-runner/dev/app-id'),
),
privateKey: GithubAppKey.fromSecret(
Secret.fromSecretNameV2(stack, 'AppKey', 'microvm-runner/dev/app-private-key'),
),
webhookSecret: Secret.fromSecretNameV2(
stack, 'WebhookSecret', 'microvm-runner/dev/webhook-secret',
),
});
NameDescription
bindEnvSerialize to the environment variables the runner set’s handlers read: GH_AUTH_KIND, GH_APP_ID or GH_APP_ID_SECRET_ARN, GH_KEY_SECRET_ARN or GH_KEY_KMS_ARN, GH_PAT_SECRET_ARN, and GH_WEBHOOK_SECRET_ARN.
grantReadGrant grantee read access to whichever credentials this auth carries: the App’s secret-backed key and/or kms:Sign on its KMS key, plus its secret-backed App ID when one is used, or the PAT secret — plus, in every case, read access to the webhook secret.
grantReadWebhookSecretGrant grantee read access to the webhook secret, and nothing else.

public bindEnv(): {[ key: string ]: string}

Serialize to the environment variables the runner set’s handlers read: GH_AUTH_KIND, GH_APP_ID or GH_APP_ID_SECRET_ARN, GH_KEY_SECRET_ARN or GH_KEY_KMS_ARN, GH_PAT_SECRET_ARN, and GH_WEBHOOK_SECRET_ARN.

Entries that do not apply are left out.

public grantRead(grantee: IGrantable): void

Grant grantee read access to whichever credentials this auth carries: the App’s secret-backed key and/or kms:Sign on its KMS key, plus its secret-backed App ID when one is used, or the PAT secret — plus, in every case, read access to the webhook secret.

This is the full set, for a handler that has to act as the App. A handler that only verifies signatures wants {@link grantReadWebhookSecret}.

  • Type: aws-cdk-lib.aws_iam.IGrantable

public grantReadWebhookSecret(grantee: IGrantable): void

Grant grantee read access to the webhook secret, and nothing else.

This is all a handler needs to verify the HMAC signature GitHub sends with every delivery. It is deliberately separate from {@link grantRead}, which also hands over the credentials that can act AS the App — minting installation tokens, registering runners. A component that only checks signatures and enqueues has no use for those, and the webhook handler is the one component reachable from the public internet.

Example

github.grantReadWebhookSecret(role);
  • Type: aws-cdk-lib.aws_iam.IGrantable

NameDescription
appAuthenticate as a GitHub App.
patAuthenticate with a personal access token.

import { GithubAuth } from 'cdk-github-microvm-runners'
GithubAuth.app(props: GithubAppAuthProps)

Authenticate as a GitHub App.

Example

const auth = GithubAuth.app({
appId: GithubAppId.fromSecret(
Secret.fromSecretNameV2(stack, 'AppId', 'microvm-runner/dev/app-id'),
),
privateKey: GithubAppKey.fromSecret(
Secret.fromSecretNameV2(stack, 'AppKey', 'microvm-runner/dev/app-private-key'),
),
webhookSecret: Secret.fromSecretNameV2(
stack, 'WebhookSecret', 'microvm-runner/dev/webhook-secret',
),
});

import { GithubAuth } from 'cdk-github-microvm-runners'
GithubAuth.pat(props: GithubPatAuthProps)

Authenticate with a personal access token.

Example

const auth = GithubAuth.pat({
token: Secret.fromSecretNameV2(stack, 'Pat', 'microvm-runner/dev/token'),
webhookSecret: Secret.fromSecretNameV2(
stack, 'WebhookSecret', 'microvm-runner/dev/webhook-secret',
),
});

NameTypeDescription
kindGithubAuthKindWhether this is App or personal-access-token authentication.
webhookSecretaws-cdk-lib.aws_secretsmanager.ISecretSecret holding the webhook secret inbound deliveries are validated against.
appIdGithubAppIdThe App’s ID, for App authentication.
privateKeyGithubAppKeyThe App’s private key, for App authentication.
tokenaws-cdk-lib.aws_secretsmanager.ISecretThe personal access token secret, for token authentication.

public readonly kind: GithubAuthKind;

Whether this is App or personal-access-token authentication.


public readonly webhookSecret: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

Secret holding the webhook secret inbound deliveries are validated against.


public readonly appId: GithubAppId;

The App’s ID, for App authentication.


public readonly privateKey: GithubAppKey;

The App’s private key, for App authentication.


public readonly token: ISecret;
  • Type: aws-cdk-lib.aws_secretsmanager.ISecret

The personal access token secret, for token authentication.


The CloudWatch metrics a runner set reports, and ready-made alarms over them. A GithubMicrovmRunners exposes its own as runners.metrics.

The metrics live in the MicrovmRunners namespace, tagged with the runner set’s id. The janitor reports one set of counters per sweep, the launcher one per launch, and the warm pool one per refill sweep. Launcher and warm-pool metrics are also tagged with the runner class the launch belongs to, which is why those accessors take a runner-class label. Every method here names one of those metrics, or the dead-letter queue’s own SQS metric; the class carries no data of its own.

Everything except deadLetterQueueDepth reports only when GithubMicrovmRunnersProps.emitMetrics is on. The accessors return a Metric either way, so a dashboard can be built ahead of turning metrics on. The two alarms over those metrics throw at synth instead, rather than synthesizing an alarm that could never fire.

Example

new cw.Alarm(stack, 'SweepErrors', {
metric: runners.metrics.errors(),
threshold: 1,
evaluationPeriods: 1,
});
import { GithubMicrovmRunnersMetrics } from 'cdk-github-microvm-runners'
new GithubMicrovmRunnersMetrics(runnerSetId: string, deadLetterQueue: IQueue, emitMetrics?: boolean)
NameTypeDescription
runnerSetIdstringNo description.
deadLetterQueueaws-cdk-lib.aws_sqs.IQueueNo description.
emitMetricsbooleanWhether the runner set reports the metrics this class names, which is GithubMicrovmRunnersProps.emitMetrics. Every accessor except deadLetterQueueDepth depends on it, though they all return a Metric either way; only the two alarms over those metrics refuse to synthesize.

  • Type: string

  • Type: aws-cdk-lib.aws_sqs.IQueue

  • Type: boolean

Whether the runner set reports the metrics this class names, which is GithubMicrovmRunnersProps.emitMetrics. Every accessor except deadLetterQueueDepth depends on it, though they all return a Metric either way; only the two alarms over those metrics refuse to synthesize.


NameDescription
cancelledBeforeLaunchLaunches skipped because the job had already stopped waiting for a runner by the time the launch was processed — cancelled, or its run deleted.
capacityRejectedLaunches the MicroVM service rejected for capacity.
coldBootLaunches served by booting a new VM, because no warm VM was available or the class keeps no warm pool.
coldSpinUpMsMilliseconds to spin up a cold launch: starting the VM, waiting for it to boot, and pushing the runner’s registration.
deadLetterQueueDepthMessages sitting in the dead-letter queue: a launch or terminate intent SQS gave up redriving.
deadLetterQueueNotEmptyAlarmAlarm when the dead-letter queue is not empty, meaning SQS gave up redriving a launch or terminate intent.
errorsJanitor sweep count: failures on individual VMs, rows, or image versions during a sweep.
imageVersionsPrunedJanitor sweep count: inactive MicroVM image versions pruned past keepImageVersions.
lifetimeKillsJanitor sweep count: VMs terminated for having run longer than maxJobDuration plus the platform’s own grace.
orphansReapedJanitor sweep count: running VMs that belong to this runner set but have no row in the runner table, reaped once a second sweep has seen the same VM unaccounted for.
poolCurrentWarm VMs suspended and available for this class as of the last warm-pool sweep.
poolLaunchedWarm VMs the last warm-pool sweep launched to reach warmPoolSize.
poolLaunchFailedWarm-VM launches a warm-pool sweep attempted and failed.
poolTargetThis class’s warmPoolSize, as the last warm-pool sweep read it.
stuckClaimsRelaunchedJanitor sweep count: launches that were claimed but never served, re-launched from the orphaned claim.
stuckLaunchesRecoveredJanitor sweep count: dead-lettered launches re-driven onto the job queue, which is 0 unless recoverStuckLaunches is on.
stuckLaunchesRecoveredAlarmAlarm on stuck-launch recoveries, the dead-lettered launches the janitor re-drove, which only happens with recoverStuckLaunches on.
stuckRunnersReapedJanitor sweep count: runners that registered with GitHub and then sat idle past idleRunnerGraceSeconds, reaped once a second sweep has seen them the same way.
suspectsClearedJanitor sweep count: VMs an earlier sweep had marked as suspect, cleared because this sweep found them accounted for or working again.
sweepErrorsAlarmAlarm on janitor sweep errors, the per-item failures a sweep isolates and continues past.
tableRowsCleanedJanitor sweep count: runner table rows deleted, either because the VM they name is confirmed gone or because a real row superseded an orphaned one.
warmHitLaunches served from the warm pool: a pre-booted VM claimed and resumed rather than a new one launched.
warmSpinUpMsMilliseconds to spin up a warm launch: claiming the VM, resuming it, and pushing the runner’s registration.
warmThrottledWarm-pool claims that were throttled and fell back to booting a new VM.

public cancelledBeforeLaunch(runnerClassLabel: string): Metric

Launches skipped because the job had already stopped waiting for a runner by the time the launch was processed — cancelled, or its run deleted.

No VM is booted for these, so a rising count is work avoided rather than work lost. It tracks how often jobs are cancelled while still queued, which is routine on a repository using concurrency groups: every re-push cancels the run it superseded. A count that dwarfs ColdBoot suggests the workflows feeding this runner set are cancelled more often than they finish, which is usually a question about their triggers rather than about the runner set.

Example

new cw.Alarm(stack, 'MostlyCancelled', {
metric: runners.metrics.cancelledBeforeLaunch('microvm'),
threshold: 50,
evaluationPeriods: 3,
});
  • Type: string

public capacityRejected(runnerClassLabel: string): Metric

Launches the MicroVM service rejected for capacity.

This is the runner set’s quota signal: a value that stays above zero means jobs are queueing behind a MicroVM quota, or behind maxConcurrentVms, rather than running, and each rejected launch spends one of its maxReceiveCount redrives on the way to the dead-letter queue. See docs/service-quotas.md.

  • Type: string

public coldBoot(runnerClassLabel: string): Metric

Launches served by booting a new VM, because no warm VM was available or the class keeps no warm pool.

  • Type: string

public coldSpinUpMs(runnerClassLabel: string): Metric

Milliseconds to spin up a cold launch: starting the VM, waiting for it to boot, and pushing the runner’s registration.

Reported as an average rather than a sum.

  • Type: string

public deadLetterQueueDepth(): Metric

Messages sitting in the dead-letter queue: a launch or terminate intent SQS gave up redriving.

public deadLetterQueueNotEmptyAlarm(scope: Construct, options?: RunnerAlarmOptions): Alarm

Alarm when the dead-letter queue is not empty, meaning SQS gave up redriving a launch or terminate intent.

A runner set that is keeping up holds this at 0, so any sustained depth means jobs are being dropped, unless recoverStuckLaunches is draining them. It fires on one message over a single 5-minute period; pass RunnerAlarmOptions to change that, and alarm.addAlarmAction() to route it.

This is the one alarm here that works without GithubMicrovmRunnersProps.emitMetrics, because it watches the dead-letter queue’s own SQS metric rather than one the handlers report.

  • Type: constructs.Construct


public errors(): Metric

Janitor sweep count: failures on individual VMs, rows, or image versions during a sweep.

The sweep isolates each one and still completes.

public imageVersionsPruned(): Metric

Janitor sweep count: inactive MicroVM image versions pruned past keepImageVersions.

public lifetimeKills(): Metric

Janitor sweep count: VMs terminated for having run longer than maxJobDuration plus the platform’s own grace.

public orphansReaped(): Metric

Janitor sweep count: running VMs that belong to this runner set but have no row in the runner table, reaped once a second sweep has seen the same VM unaccounted for.

public poolCurrent(runnerClassLabel: string): Metric

Warm VMs suspended and available for this class as of the last warm-pool sweep.

  • Type: string

public poolLaunched(runnerClassLabel: string): Metric

Warm VMs the last warm-pool sweep launched to reach warmPoolSize.

  • Type: string

public poolLaunchFailed(runnerClassLabel: string): Metric

Warm-VM launches a warm-pool sweep attempted and failed.

A value that stays above zero means the pool is not reaching warmPoolSize, so jobs keep booting new VMs instead of resuming warm ones.

  • Type: string

public poolTarget(runnerClassLabel: string): Metric

This class’s warmPoolSize, as the last warm-pool sweep read it.

  • Type: string

public stuckClaimsRelaunched(): Metric

Janitor sweep count: launches that were claimed but never served, re-launched from the orphaned claim.

This is 0 unless recoverStuckLaunches is on.

public stuckLaunchesRecovered(): Metric

Janitor sweep count: dead-lettered launches re-driven onto the job queue, which is 0 unless recoverStuckLaunches is on.

A value that stays high means launches are failing for some reason other than a GitHub outage.

public stuckLaunchesRecoveredAlarm(scope: Construct, options?: RunnerAlarmOptions): Alarm

Alarm on stuck-launch recoveries, the dead-lettered launches the janitor re-drove, which only happens with recoverStuckLaunches on.

Recoveries that keep coming mean launches are failing for some reason other than a GitHub outage. It fires on one recovery in each of three consecutive 5-minute periods, which rides out a real outage; pass RunnerAlarmOptions to change that.

Requires GithubMicrovmRunnersProps.emitMetrics, and throws at synth without it.

  • Type: constructs.Construct


public stuckRunnersReaped(): Metric

Janitor sweep count: runners that registered with GitHub and then sat idle past idleRunnerGraceSeconds, reaped once a second sweep has seen them the same way.

public suspectsCleared(): Metric

Janitor sweep count: VMs an earlier sweep had marked as suspect, cleared because this sweep found them accounted for or working again.

public sweepErrorsAlarm(scope: Construct, options?: RunnerAlarmOptions): Alarm

Alarm on janitor sweep errors, the per-item failures a sweep isolates and continues past.

A value that stays above zero means the runner set is failing to reconcile — VMs left running, runners left unreaped — even though each sweep completes. It fires on one error in each of three consecutive 5-minute periods; pass RunnerAlarmOptions to change that.

The three periods are the point. A single sweep error is usually a transient fault the next sweep sails past — a GitHub API call that lost its connection, a throttled describe — and the sweep is convergent, so the work is retried five minutes later either way. Alarming on one such blip pages an operator for something already fixed by the time they read it. A genuine reconciliation failure (expired credentials, a broken table, a revoked App installation) fails every sweep, so it still announces itself within fifteen minutes.

Requires GithubMicrovmRunnersProps.emitMetrics, and throws at synth without it.

  • Type: constructs.Construct


public tableRowsCleaned(): Metric

Janitor sweep count: runner table rows deleted, either because the VM they name is confirmed gone or because a real row superseded an orphaned one.

public warmHit(runnerClassLabel: string): Metric

Launches served from the warm pool: a pre-booted VM claimed and resumed rather than a new one launched.

  • Type: string

public warmSpinUpMs(runnerClassLabel: string): Metric

Milliseconds to spin up a warm launch: claiming the VM, resuming it, and pushing the runner’s registration.

Reported as an average rather than a sum.

  • Type: string

public warmThrottled(runnerClassLabel: string): Metric

Warm-pool claims that were throttled and fell back to booting a new VM.

The same launch can also count under ColdBoot or CapacityRejected.

  • Type: string

Build-time image logs for a runner set: the Docker build layers and the ready-probe banner an image emits while it is built.

Off unless you add it.

These logs are written while the image builds, by the image build role rather than by a VM, so image logging needs no VM execution role and puts no credentials on a runner. ConsoleLogs covers the runtime counterpart, which does need a role. The two are independent and can both be on.

Example

new GithubMicrovmRunners(stack, 'Runners', {
github,
scope,
imageLogs: ImageLogs.enabled(),
});
NameDescription
enabledSend image-build logs to CloudWatch.

import { ImageLogs } from 'cdk-github-microvm-runners'
ImageLogs.enabled(logGroup?: ILogGroup)

Send image-build logs to CloudWatch.

With no argument they go to the platform’s own group (/aws/lambda-microvms/…). Pass an ILogGroup to send them to a group whose retention and KMS key you control.

Example

const buildLogs = ImageLogs.enabled(myBuildLogGroup);
  • Type: aws-cdk-lib.aws_logs.ILogGroup

destination group.

Omitted, the platform’s own group.


NameTypeDescription
logGroupaws-cdk-lib.aws_logs.ILogGroupThe group build logs go to, when one was passed to ImageLogs.enabled(). undefined means the platform’s own group.

public readonly logGroup: ILogGroup;
  • Type: aws-cdk-lib.aws_logs.ILogGroup

The group build logs go to, when one was passed to ImageLogs.enabled(). undefined means the platform’s own group.


The memory a MicroVM runs with.

Each runner class picks one preset, and that preset becomes the memory floor of the image the class builds. Pick from the static presets below; the constructor is private.

A preset is a floor, not an allocation. It is the minimum the image is built with, and the platform provisions above it — measured at roughly four times the request, so a class on GB1 has been observed booting with about 4 GB and 2 vCPU, and one on GB4 with about 16 GB and 8 vCPU. Two things follow: a workload usually fits a smaller preset than its memory figure suggests, and the account’s memory quota is charged the measured allocation rather than the floor. The service quotas guide carries the arithmetic.

vCPU and disk follow from the preset and are not separately settable — the image resource takes a memory floor and nothing else.

Example

runners.addRunnerClass('microvm-8gb', { size: MicrovmSize.GB8 });
NameTypeDescription
memoryGbnumberMemory floor in GB.
memoryMibnumberMemory in MiB, the unit the MicroVM image’s minimumMemoryInMiB takes.

public readonly memoryGb: number;
  • Type: number

Memory floor in GB.


public readonly memoryMib: number;
  • Type: number

Memory in MiB, the unit the MicroVM image’s minimumMemoryInMiB takes.


NameTypeDescription
GB0_5MicrovmSizeMemory floor of 0.5 GB.
GB1MicrovmSizeMemory floor of 1 GB.
GB2MicrovmSizeMemory floor of 2 GB.
GB4MicrovmSizeMemory floor of 4 GB.
GB8MicrovmSizeMemory floor of 8 GB.

public readonly GB0_5: MicrovmSize;

Memory floor of 0.5 GB.


public readonly GB1: MicrovmSize;

Memory floor of 1 GB.


public readonly GB2: MicrovmSize;

Memory floor of 2 GB.


public readonly GB4: MicrovmSize;

Memory floor of 4 GB.


public readonly GB8: MicrovmSize;

Memory floor of 8 GB.


The image a runner class’s VMs boot from: one this library synthesizes, or one you author yourself.

Build one with the static factories below; the constructor is private.

Example

runners.addRunnerClass('build', {
size: MicrovmSize.GB4,
image: RunnerImage.fromOptions({
systemPackages: ['jq', 'ripgrep'],
}),
});
NameDescription
fromDockerfileUse your own Dockerfile, and the build context around it, from the directory dir.
fromInlineUse your own Dockerfile, supplied as text.
fromOptionsSynthesize a Dockerfile from opts — extra packages, setup commands, assets, environment variables, toolchains, and the actions/runner release to install.

import { RunnerImage } from 'cdk-github-microvm-runners'
RunnerImage.fromDockerfile(dir: string)

Use your own Dockerfile, and the build context around it, from the directory dir.

The whole directory is staged as the Docker build context, so a Dockerfile that needs to COPY files of its own belongs here rather than in RunnerImage.fromInline.

The contentHash recorded on the returned instance is derived from the path string. The directory’s actual contents are read and hashed later, when the image pipeline stages them as a CDK asset.

A relative dir is resolved against the process working directory, which is wherever cdk was invoked. Anchor it to the file that declares the runner class instead by passing path.join(__dirname, 'runner-image').

Example

const customImage = RunnerImage.fromDockerfile('runner-image');
  • Type: string

import { RunnerImage } from 'cdk-github-microvm-runners'
RunnerImage.fromInline(dockerfile: string)

Use your own Dockerfile, supplied as text.

The text is staged verbatim as the build context’s Dockerfile, alongside the microvm-runner/ directory the image pipeline injects and nothing else. A Dockerfile that needs to COPY files of its own belongs with RunnerImage.fromDockerfile, which stages a whole directory.

The text must COPY microvm-runner/agent.mjs and start the staged entrypoint, because that agent is what serves the MicroVM lifecycle hooks the platform calls. This is checked here, and a Dockerfile that does not copy the agent throws.

The contentHash recorded on the returned instance is a sha256 over the supplied text.

Example

const inlineImage = RunnerImage.fromInline(`
FROM public.ecr.aws/lambda/microvms:al2023-minimal
RUN dnf install -y git jq
COPY microvm-runner/agent.mjs /opt/microvm-runner/agent.mjs
COPY microvm-runner/entrypoint.sh /opt/microvm-runner/entrypoint.sh
ENTRYPOINT ["/opt/microvm-runner/entrypoint.sh"]
`);
  • Type: string

import { RunnerImage } from 'cdk-github-microvm-runners'
RunnerImage.fromOptions(opts?: RunnerImageOptions)

Synthesize a Dockerfile from opts — extra packages, setup commands, assets, environment variables, toolchains, and the actions/runner release to install.

The image’s contentHash is computed here, over the rendered Dockerfile text and the list of assets it copies.

Example

const buildImage = RunnerImage.fromOptions({
systemPackages: ['jq', 'ripgrep'],
setupCommands: ['npm install -g pnpm@10'],
environment: { LANG: 'C.UTF-8' },
toolchains: [RunnerToolchain.python('3.12.7')],
});

NameTypeDescription
additionalOsCapabilitiesstring[]Extra Linux capabilities granted to the MicroVM’s operating system.
contentHashstringsha256 content hash, part of the built image’s name.
assetsImageAsset[]The {source, target} pairs from RunnerImageOptions.assets. Set for fromOptions(), whose rendered Dockerfile copies each one into the image. undefined for fromDockerfile(), which stages your whole directory instead, and for fromInline(), whose build context holds the Dockerfile and the injected agent and nothing else.
dockerfilestringDockerfile text: rendered for fromOptions(), supplied by you for fromInline().
dockerfileDirstringThe directory holding your own Dockerfile and build context.

public readonly additionalOsCapabilities: string[];
  • Type: string[]

Extra Linux capabilities granted to the MicroVM’s operating system.

fromOptions() takes this from RunnerImageOptions; fromDockerfile() and fromInline() always carry ['ALL'].


public readonly contentHash: string;
  • Type: string

sha256 content hash, part of the built image’s name.

For fromOptions() it covers the rendered Dockerfile and the options that produced it; for fromInline(), the supplied Dockerfile text; for fromDockerfile(), the directory path.


public readonly assets: ImageAsset[];

The {source, target} pairs from RunnerImageOptions.assets. Set for fromOptions(), whose rendered Dockerfile copies each one into the image. undefined for fromDockerfile(), which stages your whole directory instead, and for fromInline(), whose build context holds the Dockerfile and the injected agent and nothing else.


public readonly dockerfile: string;
  • Type: string

Dockerfile text: rendered for fromOptions(), supplied by you for fromInline().

undefined for fromDockerfile(), whose Dockerfile lives on disk under dockerfileDir.


public readonly dockerfileDir: string;
  • Type: string

The directory holding your own Dockerfile and build context.

Set for fromDockerfile(), undefined for fromOptions() and fromInline(), which both carry their Dockerfile as dockerfile text.


How a runner set’s MicroVMs reach the network: direct internet egress, Lambda VPC runtime connectors you already have, or a connector the construct builds from a CDK VPC.

Build one with the static factories below; the constructor is private.

Example

new GithubMicrovmRunners(stack, 'Runners', {
github,
scope,
network: RunnerNetwork.vpc(vpc),
});
NameDescription
internetEgressRunners egress directly to the internet (no VPC connector).
vpcRunners egress through a network connector the construct builds from the given CDK VPC, along with the security group and the ENI-management operator role that connector needs.
vpcConnectorRunners are attached to the given Lambda runtime connector ARNs.

import { RunnerNetwork } from 'cdk-github-microvm-runners'
RunnerNetwork.internetEgress()

Runners egress directly to the internet (no VPC connector).

Example

const network = RunnerNetwork.internetEgress();
import { RunnerNetwork } from 'cdk-github-microvm-runners'
RunnerNetwork.vpc(vpc: IVpc, opts?: RunnerNetworkVpcOptions)

Runners egress through a network connector the construct builds from the given CDK VPC, along with the security group and the ENI-management operator role that connector needs.

You supply the VPC; no connector ARN is required. connectorArns is empty on the returned instance, and the construct fills in the connector’s real ARN at synth.

Example

const network = RunnerNetwork.vpc(vpc, {
subnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED },
securityGroups: [mySecurityGroup],
});
  • Type: aws-cdk-lib.aws_ec2.IVpc


import { RunnerNetwork } from 'cdk-github-microvm-runners'
RunnerNetwork.vpcConnector(connectorArns: string[])

Runners are attached to the given Lambda runtime connector ARNs.

Example

const network = RunnerNetwork.vpcConnector([
'arn:aws:lambda:us-east-1:111122223333:network-connector:my-connector',
]);
  • Type: string[]

NameTypeDescription
connectorArnsstring[]Runtime connector ARNs.
kindRunnerNetworkKindWhich networking mode this instance carries.
securityGroupsaws-cdk-lib.aws_ec2.ISecurityGroup[]Security groups for the built connector, set only for a vpc() network.
sourceVpcaws-cdk-lib.aws_ec2.IVpcThe VPC to build a connector from, set only for a vpc() network.
subnetsaws-cdk-lib.aws_ec2.SubnetSelectionSubnet selection for the built connector, set only for a vpc() network.

public readonly connectorArns: string[];
  • Type: string[]

Runtime connector ARNs.

Empty for direct internet egress, and empty for a vpc() network until the construct builds its connector at synth.


public readonly kind: RunnerNetworkKind;

Which networking mode this instance carries.


public readonly securityGroups: ISecurityGroup[];
  • Type: aws-cdk-lib.aws_ec2.ISecurityGroup[]

Security groups for the built connector, set only for a vpc() network.


public readonly sourceVpc: IVpc;
  • Type: aws-cdk-lib.aws_ec2.IVpc

The VPC to build a connector from, set only for a vpc() network.


public readonly subnets: SubnetSelection;
  • Type: aws-cdk-lib.aws_ec2.SubnetSelection

Subnet selection for the built connector, set only for a vpc() network.


Which GitHub scope registered runners are visible to: an entire organization, or an explicit list of owner/repo repositories.

Build one with the static factories below; the constructor is private.

Example

const orgScope = RunnerScope.org('my-org');
NameDescription
toJsonSerialize this scope to the JSON form the runner set’s handlers read at runtime.

public toJson(): string

Serialize this scope to the JSON form the runner set’s handlers read at runtime.

NameDescription
orgRunners are registered at the organization level.
reposRunners are registered against an explicit list of owner/repo repos.

import { RunnerScope } from 'cdk-github-microvm-runners'
RunnerScope.org(org: string)

Runners are registered at the organization level.

Example

const orgScope = RunnerScope.org('my-org');
  • Type: string

import { RunnerScope } from 'cdk-github-microvm-runners'
RunnerScope.repos(repos: string[])

Runners are registered against an explicit list of owner/repo repos.

Example

const repoScope = RunnerScope.repos(['my-org/api', 'my-org/web']);
  • Type: string[]

NameTypeDescription
kindRunnerScopeKindWhether this scope is an organization or a list of repositories.
organizationstringThe organization, for a scope built with RunnerScope.org().
repositoriesstring[]The owner/repo list, for a scope built with RunnerScope.repos().

public readonly kind: RunnerScopeKind;

Whether this scope is an organization or a list of repositories.


public readonly organization: string;
  • Type: string

The organization, for a scope built with RunnerScope.org().


public readonly repositories: string[];
  • Type: string[]

The owner/repo list, for a scope built with RunnerScope.repos().


A language runtime baked into the runner image’s hosted tool cache at /opt/hostedtoolcache, where actions/setup-python and actions/setup-node find it without downloading anything.

Those actions otherwise fetch OS-specific prebuilt runtimes, which are not published for the AL2023 image these runners use.

Several versions can be baked in at once, and a workflow asking for python-version: "3.12" matches a baked 3.12.7.

Build one with the static factories below; the constructor is private.

Example

const testImage = RunnerImage.fromOptions({
toolchains: [
RunnerToolchain.python('3.12.7'),
RunnerToolchain.node('22.11.0'),
],
});
NameDescription
nodeNode.js, from the official arm64 tarball. Full semver, e.g. '22.11.0'.
pythonCPython, built from source.

import { RunnerToolchain } from 'cdk-github-microvm-runners'
RunnerToolchain.node(version: string)

Node.js, from the official arm64 tarball. Full semver, e.g. '22.11.0'.

Example

const node = RunnerToolchain.node('22.11.0');
  • Type: string

import { RunnerToolchain } from 'cdk-github-microvm-runners'
RunnerToolchain.python(version: string)

CPython, built from source.

version is a full semver, e.g. '3.12.7'.

Example

const python = RunnerToolchain.python('3.12.7');
  • Type: string

NameTypeDescription
kindToolchainKindWhich runtime this is.
versionstringThe full semver release baked in, e.g. '3.12.7'.

public readonly kind: ToolchainKind;

Which runtime this is.


public readonly version: string;
  • Type: string

The full semver release baked in, e.g. '3.12.7'.


Which actions/runner release to install on the MicroVM image.

Build one with the static factories below; the constructor is private.

Example

const pinnedImage = RunnerImage.fromOptions({
runnerVersion: RunnerVersion.of('2.328.0'),
});
NameDescription
latestUse the actions/runner release this library currently pins (DEFAULT_RUNNER_VERSION).
ofPin an explicit actions/runner release, e.g. "2.319.1".

import { RunnerVersion } from 'cdk-github-microvm-runners'
RunnerVersion.latest()

Use the actions/runner release this library currently pins (DEFAULT_RUNNER_VERSION).

No version is carried on the instance; the image build fills the pinned value in at synth.

Example

const runnerVersion = RunnerVersion.latest();
import { RunnerVersion } from 'cdk-github-microvm-runners'
RunnerVersion.of(version: string)

Pin an explicit actions/runner release, e.g. "2.319.1".

Example

const pinnedRunner = RunnerVersion.of('2.328.0');
  • Type: string

NameTypeDescription
versionstringThe pinned release, for a version built with RunnerVersion.of(). undefined for RunnerVersion.latest().

public readonly version: string;
  • Type: string

The pinned release, for a version built with RunnerVersion.of(). undefined for RunnerVersion.latest().


How the webhook handler is exposed to GitHub’s workflow_job deliveries.

The one form today is a Lambda Function URL. It is created with authType: NONE; the auth boundary is the HMAC-SHA256 signature GitHub sends with every delivery, which the handler verifies against the webhook secret before it does anything else.

Example

new GithubMicrovmRunners(stack, 'Runners', {
github,
scope,
webhook: WebhookEndpoint.functionUrl(),
});
NameDescription
functionUrlExpose the webhook handler on a Lambda Function URL.

import { WebhookEndpoint } from 'cdk-github-microvm-runners'
WebhookEndpoint.functionUrl()

Expose the webhook handler on a Lambda Function URL.

Example

const webhook = WebhookEndpoint.functionUrl();
NameTypeDescription
kindWebhookEndpointKindWhich form of endpoint this instance represents.

public readonly kind: WebhookEndpointKind;

Which form of endpoint this instance represents.


Which credential flow a GithubAuth represents.

NameDescription
APPA GitHub App.
PATA personal access token.

A GitHub App.


A personal access token.


Which networking mode a RunnerNetwork carries.

NameDescription
INTERNETDirect internet egress, with no Lambda VPC runtime connector.
CONNECTORSRunners attached to caller-supplied Lambda runtime connector ARNs.
VPCRunners attached to a connector the construct builds from a CDK VPC.

Direct internet egress, with no Lambda VPC runtime connector.


Runners attached to caller-supplied Lambda runtime connector ARNs.


Runners attached to a connector the construct builds from a CDK VPC.


Which GitHub scope a RunnerScope represents.

NameDescription
ORGRunners are registered at the organization level.
REPOSRunners are registered against an explicit list of repositories.

Runners are registered at the organization level.


Runners are registered against an explicit list of repositories.


How a toolchain is installed into the image’s hosted tool cache.

NameDescription
PYTHONCPython, built from source (configure --prefix … --enable-shared) on AL2023.
NODENode.js, unpacked from the official nodejs.org linux-arm64 tarball.

CPython, built from source (configure --prefix … --enable-shared) on AL2023.


Node.js, unpacked from the official nodejs.org linux-arm64 tarball.


Which form of endpoint a WebhookEndpoint represents.

NameDescription
FUNCTION_URLA Lambda Function URL.

A Lambda Function URL.