Skip to content

GitHubRunners Construct ​

Create all the required infrastructure to provide self-hosted GitHub runners.

It creates a webhook, secrets, and a step function to orchestrate all runs. Secrets are not automatically filled. See Setup GitHub for instructions on how to setup GitHub integration.

By default, this will create a runner provider of each available type with the defaults. This is good enough for the initial setup stage when you just want to get GitHub integration working.

ts
new GitHubRunners(this, 'runners');
python
GitHubRunners(self, "runners")
java
new GitHubRunners(this, "runners");
csharp
new GitHubRunners(this, "runners");
go
NewGitHubRunners(this, jsii.String("runners"))

Usually you'd want to configure the runner providers so the runners can run in a certain VPC or have certain permissions.

ts
const vpc = ec2.Vpc.fromLookup(this, 'vpc', { vpcId: 'vpc-1234567' });
const runnerSg = new ec2.SecurityGroup(this, 'runner security group', { vpc: vpc });
const dbSg = ec2.SecurityGroup.fromSecurityGroupId(this, 'database security group', 'sg-1234567');
const bucket = new s3.Bucket(this, 'runner bucket');

// create a custom CodeBuild provider
const myProvider = new CodeBuildRunnerProvider(
  this, 'codebuild runner',
  {
     labels: ['my-codebuild'],
     vpc: vpc,
     securityGroups: [runnerSg],
  },
);
// grant some permissions to the provider
bucket.grantReadWrite(myProvider);
dbSg.connections.allowFrom(runnerSg, ec2.Port.tcp(3306), 'allow runners to connect to MySQL database');

// create the runner infrastructure
new GitHubRunners(
  this,
  'runners',
  {
    providers: [myProvider],
  }
);
python
vpc = ec2.Vpc.from_lookup(self, "vpc", vpc_id="vpc-1234567")
runner_sg = ec2.SecurityGroup(self, "runner security group", vpc=vpc)
db_sg = ec2.SecurityGroup.from_security_group_id(self, "database security group", "sg-1234567")
bucket = s3.Bucket(self, "runner bucket")

# create a custom CodeBuild provider
my_provider = CodeBuildRunnerProvider(self, "codebuild runner",
    labels=["my-codebuild"],
    vpc=vpc,
    security_groups=[runner_sg]
)
# grant some permissions to the provider
bucket.grant_read_write(my_provider)
db_sg.connections.allow_from(runner_sg, ec2.Port.tcp(3306), "allow runners to connect to MySQL database")

# create the runner infrastructure
GitHubRunners(self, "runners",
    providers=[my_provider]
)
java
Object vpc = ec2.Vpc.fromLookup(this, "vpc", Map.of("vpcId", "vpc-1234567"));
Object runnerSg = SecurityGroup.Builder.create(this, "runner security group").vpc(vpc).build();
Object dbSg = ec2.SecurityGroup.fromSecurityGroupId(this, "database security group", "sg-1234567");
Object bucket = new Bucket(this, "runner bucket");

// create a custom CodeBuild provider
Object myProvider = CodeBuildRunnerProvider.Builder.create(this, "codebuild runner")
        .labels(List.of("my-codebuild"))
        .vpc(vpc)
        .securityGroups(List.of(runnerSg))
        .build();
// grant some permissions to the provider
bucket.grantReadWrite(myProvider);
dbSg.connections.allowFrom(runnerSg, ec2.Port.tcp(3306), "allow runners to connect to MySQL database");

// create the runner infrastructure
// create the runner infrastructure
GitHubRunners.Builder.create(this, "runners")
        .providers(List.of(myProvider))
        .build();
csharp
var vpc = ec2.Vpc.FromLookup(this, "vpc", new Struct { VpcId = "vpc-1234567" });
var runnerSg = new ec2.SecurityGroup(this, "runner security group", new Struct { Vpc = vpc });
var dbSg = ec2.SecurityGroup.FromSecurityGroupId(this, "database security group", "sg-1234567");
var bucket = new s3.Bucket(this, "runner bucket");

// create a custom CodeBuild provider
var myProvider = new CodeBuildRunnerProvider(this, "codebuild runner", new Struct {
    Labels = new [] { "my-codebuild" },
    Vpc = vpc,
    SecurityGroups = new [] { runnerSg }
});
// grant some permissions to the provider
bucket.GrantReadWrite(myProvider);
dbSg.Connections.AllowFrom(runnerSg, ec2.Port.Tcp(3306), "allow runners to connect to MySQL database");

// create the runner infrastructure
// create the runner infrastructure
new GitHubRunners(this, "runners", new Struct {
    Providers = new [] { myProvider }
});
go
vpc := ec2.vpc_FromLookup(this, jsii.String("vpc"), map[string]*string{
	"vpcId": jsii.String("vpc-1234567"),
})
runnerSg := ec2.NewSecurityGroup(this, jsii.String("runner security group"), map[string]interface{}{
	"vpc": vpc,
})
dbSg := ec2.securityGroup_FromSecurityGroupId(this, jsii.String("database security group"), jsii.String("sg-1234567"))
bucket := s3.NewBucket(this, jsii.String("runner bucket"))

// create a custom CodeBuild provider
myProvider := NewCodeBuildRunnerProvider(this, jsii.String("codebuild runner"), map[string]interface{}{
	"labels": []*string{
		jsii.String("my-codebuild"),
	},
	"vpc": vpc,
	"securityGroups": []interface{}{
		runnerSg,
	},
})
// grant some permissions to the provider
bucket.grantReadWrite(myProvider)
dbSg.connections.allowFrom(runnerSg, ec2.port_Tcp(jsii.Number(3306)), jsii.String("allow runners to connect to MySQL database"))

// create the runner infrastructure
// create the runner infrastructure
NewGitHubRunners(this, jsii.String("runners"), map[string][]interface{}{
	"providers": []interface{}{
		myProvider,
	},
})

Implements: IConnectable

Initializer ​

ts
import { GitHubRunners } from '@cloudsnorkel/cdk-github-runners'

new GitHubRunners(scope: Construct, id: string, props?: GitHubRunnersProps)
python
import cloudsnorkel.cdk_github_runners

cloudsnorkel.cdk_github_runners.GitHubRunners(
  scope: Construct,
  id: str,
  allow_public_subnet: bool = None,
  extra_certificates: str = None,
  idle_timeout: Duration = None,
  log_options: LogOptions = None,
  providers: typing.List[IRunnerProvider | ICompositeProvider] = None,
  provider_selector: IFunction = None,
  require_self_hosted_label: bool = None,
  retry_options: ProviderRetryOptions = None,
  security_groups: typing.List[ISecurityGroup] = None,
  setup_access: LambdaAccess = None,
  status_access: LambdaAccess = None,
  vpc: IVpc = None,
  vpc_subnets: SubnetSelection = None,
  webhook_access: LambdaAccess = None
)
  • scope: Construct

  • id: str

  • allow_public_subnet?: bool

    Allow management functions to run in public subnets. Lambda Functions in a public subnet can NOT access the internet.

    Note: This only affects management functions that interact with GitHub. Lambda functions that help with runner image building and don't interact with GitHub are NOT affected by this setting.

    Default: false

  • extra_certificates?: str

    Path to a certificate file (.pem or .crt) or a directory containing certificate files (.pem or .crt) required to trust GitHub Enterprise Server. Use this when GitHub Enterprise Server certificates are self-signed.

    If a directory is provided, all .pem and .crt files in that directory will be used. The certificates will be concatenated into a single file for use by Node.js.

    You may also want to use custom images for your runner providers that contain the same certificates. See RunnerImageComponent.extraCertificates().

    python
    # Example automatically generated from non-compiling source. May contain errors.
    self_signed_certificates = "certs/ghes.pem" # or 'path-to-my-extra-certs-folder' for a directory
    image_builder = CodeBuildRunnerProvider.image_builder(self, "Image Builder with Certs")
    image_builder.add_component(RunnerImageComponent.extra_certificates(self_signed_certificates, "private-ca"))
    
    provider = CodeBuildRunnerProvider(self, "CodeBuild",
        image_builder=image_builder
    )
    
    GitHubRunners(self, "runners",
        providers=[provider],
        extra_certificates=self_signed_certificates
    )
  • idle_timeout?: Duration

    Time to wait before stopping a runner that remains idle.

    If the user cancelled the job, or if another runner stole it, this stops the runner to avoid wasting resources.

    Default: 5 minutes

  • log_options?: LogOptions

    Logging options for the state machine that manages the runners.

    Default: no logs

  • providers?: typing.List[IRunnerProvider | ICompositeProvider]

    List of runner providers to use.

    At least one provider is required. Provider will be selected when its label matches the labels requested by the workflow job.

    Default: CodeBuild, Lambda and Fargate runners with all the defaults (no VPC or default account VPC)

  • provider_selector?: IFunction

    Optional Lambda function to customize provider selection logic and label assignment.

    • The function receives the webhook payload along with default provider and its labels as ProviderSelectorInput
    • The function returns a selected provider and its labels as ProviderSelectorResult
    • You can decline to provision a runner by returning undefined as the provider in the selector result
    • You can fully customize the labels for the about-to-be-provisioned runner (add, remove, modify, dynamic labels, etc.)
    • Labels don't have to match the labels originally configured for the provider, but see warnings below
    • This function will be called synchronously during webhook processing, so it should be fast and efficient (webhook limit is 30 seconds total)

    WARNING: It is your responsibility to ensure the selected provider's labels match the job's required labels. If you return the wrong labels, the runner will be created but GitHub Actions will not assign the job to it.

    WARNING: Provider selection is not a guarantee that a specific provider will be assigned for the job. GitHub Actions may assign the job to any runner with matching labels. The provider selector only determines which provider's runner will be created, but GitHub Actions may route the job to any available runner with the required labels.

    **For reliable provider assignment based on job characteristics, consider using repo-level runner registration where you can control which runners are available for specific repositories. This information is also available while using the setup wizard.

  • require_self_hosted_label?: bool

    Whether to require the self-hosted label.

    If true, the runner will only start if the workflow job explicitly requests the self-hosted label.

    Be careful when setting this to false. Avoid setting up providers with generic label requirements like linux as they may match workflows that are not meant to run on self-hosted runners.

    Default: true

  • retry_options?: ProviderRetryOptions

    Options to retry operation in case of failure like missing capacity, or API quota issues.

    GitHub jobs time out after not being able to get a runner for 24 hours. You should not retry for more than 24 hours.

    Retries use full jitter, so total time spent waiting is about half the sum of min(interval * backoffRate ^ attempt, maxDelay) over all attempts.

    Default: retry 210 times over a bit more than 24 hours

  • security_groups?: typing.List[ISecurityGroup]

    Security groups attached to all management functions.

    Use this to provide outbound access from management functions to GitHub Enterprise Server hosted inside a VPC.

    Note: This only affects management functions that interact with GitHub. Lambda functions that help with runner image building and don't interact with GitHub are NOT affected by this setting.

    Note: Defining inbound rules on this security group does nothing. This security group only controls outbound access FROM the management functions. To limit access TO the webhook or setup functions, use GitHubRunnersProps.webhookAccess and GitHubRunnersProps.setupAccess instead.

  • setup_access?: LambdaAccess

    Access configuration for the setup function.

    Once you finish the setup process, you can set this to LambdaAccess.noAccess() to remove access to the setup function. You can also use LambdaAccess.apiGateway({ allowedIps: ['my-ip/0']}) to limit access to your IP only.

    Default: LambdaAccess.lambdaUrl()

  • status_access?: LambdaAccess

    Access configuration for the status function.

    This function returns a lot of sensitive information about the runner, so you should only allow access to it from trusted IPs, if at all.

    Default: LambdaAccess.noAccess()

  • vpc?: IVpc

    VPC used for all management functions. Use this with GitHub Enterprise Server hosted that's inaccessible from outside the VPC.

    Note: This only affects management functions that interact with GitHub. Lambda functions that help with runner image building and don't interact with GitHub are NOT affected by this setting and will run outside the VPC.

    Make sure the selected VPC and subnets have access to the following with either NAT Gateway or VPC Endpoints:

    • GitHub Enterprise Server
    • Secrets Manager
    • SQS
    • Step Functions
    • DynamoDB
    • Lambda (only with GitHubRunnersProps.providerSelector)
    • CloudFormation (status function only)
    • EC2
    • ECR (status function only)
  • vpc_subnets?: SubnetSelection

    VPC subnets used for all management functions.

    Use this with GitHub Enterprise Server hosted that's inaccessible from outside the VPC.

    Note: This only affects management functions that interact with GitHub. Lambda functions that help with runner image building and don't interact with GitHub are NOT affected by this setting.

  • webhook_access?: LambdaAccess

    Access configuration for the webhook function.

    This function is called by GitHub when a new workflow job is scheduled. For an extra layer of security, you can set this to LambdaAccess.apiGateway({ allowedIps: LambdaAccess.githubWebhookIps() }).

    You can also set this to LambdaAccess.apiGateway({allowedVpc: vpc, allowedIps: ['GHES.IP.ADDRESS/32']}) if your GitHub Enterprise Server is hosted in a VPC. This will create an API Gateway endpoint that's only accessible from within the VPC.

    WARNING: changing access type may change the URL. When the URL changes, you must update GitHub as well.

    Default: LambdaAccess.lambdaUrl()

java
import com.cloudsnorkel.cdk.github.runners.GitHubRunners;

GitHubRunners.Builder.create(Construct scope, java.lang.String id)
//  .allowPublicSubnet(java.lang.Boolean)
//  .extraCertificates(java.lang.String)
//  .idleTimeout(Duration)
//  .logOptions(LogOptions)
//  .providers(java.util.List<IRunnerProvider|ICompositeProvider>)
//  .providerSelector(IFunction)
//  .requireSelfHostedLabel(java.lang.Boolean)
//  .retryOptions(ProviderRetryOptions)
//  .securityGroups(java.util.List<ISecurityGroup>)
//  .setupAccess(LambdaAccess)
//  .statusAccess(LambdaAccess)
//  .vpc(IVpc)
//  .vpcSubnets(SubnetSelection)
//  .webhookAccess(LambdaAccess)
    .build();
  • scope: Construct

  • id: java.lang.String

  • allowPublicSubnet?: java.lang.Boolean

    Allow management functions to run in public subnets. Lambda Functions in a public subnet can NOT access the internet.

    Note: This only affects management functions that interact with GitHub. Lambda functions that help with runner image building and don't interact with GitHub are NOT affected by this setting.

    Default: false

  • extraCertificates?: java.lang.String

    Path to a certificate file (.pem or .crt) or a directory containing certificate files (.pem or .crt) required to trust GitHub Enterprise Server. Use this when GitHub Enterprise Server certificates are self-signed.

    If a directory is provided, all .pem and .crt files in that directory will be used. The certificates will be concatenated into a single file for use by Node.js.

    You may also want to use custom images for your runner providers that contain the same certificates. See RunnerImageComponent.extraCertificates().

    java
    // Example automatically generated from non-compiling source. May contain errors.
    String selfSignedCertificates = "certs/ghes.pem"; // or 'path-to-my-extra-certs-folder' for a directory
    Object imageBuilder = CodeBuildRunnerProvider.imageBuilder(this, "Image Builder with Certs");
    imageBuilder.addComponent(RunnerImageComponent.extraCertificates(selfSignedCertificates, "private-ca"));
    
    Object provider = CodeBuildRunnerProvider.Builder.create(this, "CodeBuild")
            .imageBuilder(imageBuilder)
            .build();
    
    GitHubRunners.Builder.create(this, "runners")
            .providers(List.of(provider))
            .extraCertificates(selfSignedCertificates)
            .build();
  • idleTimeout?: Duration

    Time to wait before stopping a runner that remains idle.

    If the user cancelled the job, or if another runner stole it, this stops the runner to avoid wasting resources.

    Default: 5 minutes

  • logOptions?: LogOptions

    Logging options for the state machine that manages the runners.

    Default: no logs

  • providers?: java.util.List<IRunnerProvider|ICompositeProvider>

    List of runner providers to use.

    At least one provider is required. Provider will be selected when its label matches the labels requested by the workflow job.

    Default: CodeBuild, Lambda and Fargate runners with all the defaults (no VPC or default account VPC)

  • providerSelector?: IFunction

    Optional Lambda function to customize provider selection logic and label assignment.

    • The function receives the webhook payload along with default provider and its labels as ProviderSelectorInput
    • The function returns a selected provider and its labels as ProviderSelectorResult
    • You can decline to provision a runner by returning undefined as the provider in the selector result
    • You can fully customize the labels for the about-to-be-provisioned runner (add, remove, modify, dynamic labels, etc.)
    • Labels don't have to match the labels originally configured for the provider, but see warnings below
    • This function will be called synchronously during webhook processing, so it should be fast and efficient (webhook limit is 30 seconds total)

    WARNING: It is your responsibility to ensure the selected provider's labels match the job's required labels. If you return the wrong labels, the runner will be created but GitHub Actions will not assign the job to it.

    WARNING: Provider selection is not a guarantee that a specific provider will be assigned for the job. GitHub Actions may assign the job to any runner with matching labels. The provider selector only determines which provider's runner will be created, but GitHub Actions may route the job to any available runner with the required labels.

    **For reliable provider assignment based on job characteristics, consider using repo-level runner registration where you can control which runners are available for specific repositories. This information is also available while using the setup wizard.

  • requireSelfHostedLabel?: java.lang.Boolean

    Whether to require the self-hosted label.

    If true, the runner will only start if the workflow job explicitly requests the self-hosted label.

    Be careful when setting this to false. Avoid setting up providers with generic label requirements like linux as they may match workflows that are not meant to run on self-hosted runners.

    Default: true

  • retryOptions?: ProviderRetryOptions

    Options to retry operation in case of failure like missing capacity, or API quota issues.

    GitHub jobs time out after not being able to get a runner for 24 hours. You should not retry for more than 24 hours.

    Retries use full jitter, so total time spent waiting is about half the sum of min(interval * backoffRate ^ attempt, maxDelay) over all attempts.

    Default: retry 210 times over a bit more than 24 hours

  • securityGroups?: java.util.List<ISecurityGroup>

    Security groups attached to all management functions.

    Use this to provide outbound access from management functions to GitHub Enterprise Server hosted inside a VPC.

    Note: This only affects management functions that interact with GitHub. Lambda functions that help with runner image building and don't interact with GitHub are NOT affected by this setting.

    Note: Defining inbound rules on this security group does nothing. This security group only controls outbound access FROM the management functions. To limit access TO the webhook or setup functions, use GitHubRunnersProps.webhookAccess and GitHubRunnersProps.setupAccess instead.

  • setupAccess?: LambdaAccess

    Access configuration for the setup function.

    Once you finish the setup process, you can set this to LambdaAccess.noAccess() to remove access to the setup function. You can also use LambdaAccess.apiGateway({ allowedIps: ['my-ip/0']}) to limit access to your IP only.

    Default: LambdaAccess.lambdaUrl()

  • statusAccess?: LambdaAccess

    Access configuration for the status function.

    This function returns a lot of sensitive information about the runner, so you should only allow access to it from trusted IPs, if at all.

    Default: LambdaAccess.noAccess()

  • vpc?: IVpc

    VPC used for all management functions. Use this with GitHub Enterprise Server hosted that's inaccessible from outside the VPC.

    Note: This only affects management functions that interact with GitHub. Lambda functions that help with runner image building and don't interact with GitHub are NOT affected by this setting and will run outside the VPC.

    Make sure the selected VPC and subnets have access to the following with either NAT Gateway or VPC Endpoints:

    • GitHub Enterprise Server
    • Secrets Manager
    • SQS
    • Step Functions
    • DynamoDB
    • Lambda (only with GitHubRunnersProps.providerSelector)
    • CloudFormation (status function only)
    • EC2
    • ECR (status function only)
  • vpcSubnets?: SubnetSelection

    VPC subnets used for all management functions.

    Use this with GitHub Enterprise Server hosted that's inaccessible from outside the VPC.

    Note: This only affects management functions that interact with GitHub. Lambda functions that help with runner image building and don't interact with GitHub are NOT affected by this setting.

  • webhookAccess?: LambdaAccess

    Access configuration for the webhook function.

    This function is called by GitHub when a new workflow job is scheduled. For an extra layer of security, you can set this to LambdaAccess.apiGateway({ allowedIps: LambdaAccess.githubWebhookIps() }).

    You can also set this to LambdaAccess.apiGateway({allowedVpc: vpc, allowedIps: ['GHES.IP.ADDRESS/32']}) if your GitHub Enterprise Server is hosted in a VPC. This will create an API Gateway endpoint that's only accessible from within the VPC.

    WARNING: changing access type may change the URL. When the URL changes, you must update GitHub as well.

    Default: LambdaAccess.lambdaUrl()

csharp
using CloudSnorkel;

new GitHubRunners(Construct Scope, string Id, GitHubRunnersProps Props = null);
go
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"

cloudsnorkelcdkgithubrunners.NewGitHubRunners(scope Construct, id *string, props GitHubRunnersProps) GitHubRunners

Methods ​

toString()to_string()toString()ToString()ToString() ​

Returns a string representation of this construct.

ts
public toString(): string
python
def to_string() -> str
java
public java.lang.String toString()
csharp
private string ToString()
go
func ToString() *string

with()with()with()With()With() ​

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.

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

    The mixins to apply.

python
def with(
  mixins: *IMixin
) -> IConstruct
  • mixins: *IMixin

    The mixins to apply.

java
public IConstruct with(IMixin... mixins)
  • mixins: IMixin...

    The mixins to apply.

csharp
private IConstruct With(params IMixin[] Mixins)
  • Mixins: params IMixin[]

    The mixins to apply.

go
func With(mixins ...IMixin) IConstruct
  • mixins: ...IMixin

    The mixins to apply.

createDashboard()create_dashboard()createDashboard()CreateDashboard()CreateDashboard() ​

Creates a CloudWatch dashboard with the metrics you need to know if your runners are healthy.

It's split into sections, each with a short explanation of what its numbers mean and which ones to watch:

  • Jobs: are jobs running and passing, and which runner is failing them?
  • Runners: do runners start, how long do they take (and therefore cost), and why do they fail to start?
  • Runner assignment: are runners taken by jobs they weren't started for, do jobs match more than one provider, and why were runners stopped before getting a job?
  • Management functions (orchestration): is GitHub reaching the webhook, and is any of our code failing?

WARNING: this method calls GitHubRunners.metricJobCompleted(), GitHubRunners.metricStolenRunners(), GitHubRunners.metricStoppedRunners() and GitHubRunners.metricJobsMatchingMultipleProviders() which create metric filters. These resources may incur cost.

This dashboard is very basic. Pull requests and issues are welcome to improve it.

ts
public createDashboard(name?: string): Dashboard
  • name?: string

    Name of the dashboard.

    Defaults to "GitHub-Runners".

python
def create_dashboard(
  name: str = None
) -> Dashboard
  • name?: str

    Name of the dashboard.

    Defaults to "GitHub-Runners".

java
public Dashboard createDashboard()
public Dashboard createDashboard(java.lang.String name)
  • name?: java.lang.String

    Name of the dashboard.

    Defaults to "GitHub-Runners".

csharp
private Dashboard CreateDashboard(string Name = null)
  • Name?: string

    Name of the dashboard.

    Defaults to "GitHub-Runners".

go
func CreateDashboard(name *string) Dashboard
  • name?: *string

    Name of the dashboard.

    Defaults to "GitHub-Runners".

createLogsInsightsQueries()create_logs_insights_queries()createLogsInsightsQueries()CreateLogsInsightsQueries()CreateLogsInsightsQueries() ​

Creates CloudWatch Logs Insights saved queries that can be used to debug issues with the runners.

  • "Webhook errors" helps diagnose configuration issues with GitHub integration
  • "Ignored webhook" helps understand why runners aren't started
  • "Ignored jobs based on labels" helps debug label matching issues
  • "Webhook started runners" helps understand which runners were started
  • "Jobs matching multiple providers" lists jobs that need more labels so they match only one provider
  • "Warm runner status" and "Warm runner errors" (when warm runners are configured)
ts
public createLogsInsightsQueries(prefix?: string): void
  • prefix?: string

    Prefix for the query definitions.

    Defaults to "GitHub Runners".

python
def create_logs_insights_queries(
  prefix: str = None
) -> None
  • prefix?: str

    Prefix for the query definitions.

    Defaults to "GitHub Runners".

java
public void createLogsInsightsQueries()
public void createLogsInsightsQueries(java.lang.String prefix)
  • prefix?: java.lang.String

    Prefix for the query definitions.

    Defaults to "GitHub Runners".

csharp
private void CreateLogsInsightsQueries(string Prefix = null)
  • Prefix?: string

    Prefix for the query definitions.

    Defaults to "GitHub Runners".

go
func CreateLogsInsightsQueries(prefix *string)
  • prefix?: *string

    Prefix for the query definitions.

    Defaults to "GitHub Runners".

failedImageBuildsTopic()failed_image_builds_topic()failedImageBuildsTopic()FailedImageBuildsTopic()FailedImageBuildsTopic() ​

Creates a topic for notifications when a runner image build fails.

Runner images are rebuilt every week by default. This provides the latest GitHub Runner version and software updates.

If you want to be sure you are using the latest runner version, you can use this topic to be notified when a build fails.

Email subscribers get a short summary with the failure reason and a link to the logs. Other subscribers get the original JSON notification from CodeBuild or EC2 Image Builder.

When the image builder is defined in a separate stack (e.g. in a split-stacks setup), pass that stack or construct as the optional scope so the topic and failure-notification aspects are created in the same stack as the image builder. Otherwise the aspects may not find the image builder resources.

ts
public failedImageBuildsTopic(scope?: Construct): Topic
  • scope?: Construct

    Optional scope (e.g. the image builder stack) where the topic and aspects will be created. Defaults to this construct.

python
def failed_image_builds_topic(
  scope: Construct = None
) -> Topic
  • scope?: Construct

    Optional scope (e.g. the image builder stack) where the topic and aspects will be created. Defaults to this construct.

java
public Topic failedImageBuildsTopic()
public Topic failedImageBuildsTopic(Construct scope)
  • scope?: Construct

    Optional scope (e.g. the image builder stack) where the topic and aspects will be created. Defaults to this construct.

csharp
private Topic FailedImageBuildsTopic(Construct Scope = null)
  • Scope?: Construct

    Optional scope (e.g. the image builder stack) where the topic and aspects will be created. Defaults to this construct.

go
func FailedImageBuildsTopic(scope Construct) Topic
  • scope?: Construct

    Optional scope (e.g. the image builder stack) where the topic and aspects will be created. Defaults to this construct.

metricFailed()metric_failed()metricFailed()MetricFailed()MetricFailed() ​

Metric for failed runner executions.

A failed runner usually means the runner failed to start and so a job was never executed. It doesn't necessarily mean the job was executed and failed. For that, see GitHubRunners.metricJobCompleted().

ts
public metricFailed(props?: MetricOptions): Metric
python
def metric_failed(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  id: str = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  stack_account: str = None,
  stack_region: str = None,
  statistic: str = None,
  unit: Unit = None,
  visible: bool = None
) -> Metric
  • account?: str

    Account which this metric comes from.

    Default: - Deployment account.

  • color?: str

    The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.

    Default: - Automatic color

  • dimensions_map?: typing.Mapping[str]

    Dimensions of the metric.

    Default: - No dimensions.

  • id?: str

    Unique identifier for this metric when used in dashboard widgets.

    The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.

    Default: - No ID

  • label?: str

    Label for this metric when added to a Graph in a Dashboard.

    You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

    [max: ${MAX}] MyMetric

    As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.

    Default: - No label

  • period?: Duration

    The period over which the specified statistic is applied.

    Default: Duration.minutes(5)

  • region?: str

    Region which this metric comes from.

    Default: - Deployment region.

  • stack_account?: str

    Account of the stack this metric is attached to.

    Default: - Deployment account.

  • stack_region?: str

    Region of the stack this metric is attached to.

    Default: - Deployment region.

  • statistic?: str

    What function to use for aggregating.

    Use the aws_cloudwatch.Stats helper class to construct valid input strings.

    Can be one of the following:

    • "Minimum" | "min"
    • "Maximum" | "max"
    • "Average" | "avg"
    • "Sum" | "sum"
    • "SampleCount | "n"
    • "pNN.NN"
    • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
    • "iqm"
    • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
    • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
    • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

    Default: Average

  • unit?: Unit

    Unit used to filter the metric stream.

    Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

    The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

    CloudWatch does not honor this property for graphs.

    Default: - All metric datums in the given metric stream

  • visible?: bool

    Whether this metric should be visible in dashboard graphs.

    Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results.

    Default: true

java
public Metric metricFailed()
public Metric metricFailed(MetricOptions props)
csharp
private Metric MetricFailed(MetricOptions Props = null)
go
func MetricFailed(props MetricOptions) Metric

metricJobCompleted()metric_job_completed()metricJobCompleted()MetricJobCompleted()MetricJobCompleted() ​

Metric for the number of GitHub Actions jobs completed.

It has ProviderLabels and Status dimensions. The status can be one of "Succeeded", "SucceededWithIssues", "Failed", "Canceled", "Skipped", or "Abandoned".

WARNING: this method creates a metric filter for each provider. Each metric has a status dimension with six possible values. These resources may incur cost.

ts
public metricJobCompleted(props?: MetricOptions): Metric
python
def metric_job_completed(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  id: str = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  stack_account: str = None,
  stack_region: str = None,
  statistic: str = None,
  unit: Unit = None,
  visible: bool = None
) -> Metric
  • account?: str

    Account which this metric comes from.

    Default: - Deployment account.

  • color?: str

    The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.

    Default: - Automatic color

  • dimensions_map?: typing.Mapping[str]

    Dimensions of the metric.

    Default: - No dimensions.

  • id?: str

    Unique identifier for this metric when used in dashboard widgets.

    The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.

    Default: - No ID

  • label?: str

    Label for this metric when added to a Graph in a Dashboard.

    You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

    [max: ${MAX}] MyMetric

    As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.

    Default: - No label

  • period?: Duration

    The period over which the specified statistic is applied.

    Default: Duration.minutes(5)

  • region?: str

    Region which this metric comes from.

    Default: - Deployment region.

  • stack_account?: str

    Account of the stack this metric is attached to.

    Default: - Deployment account.

  • stack_region?: str

    Region of the stack this metric is attached to.

    Default: - Deployment region.

  • statistic?: str

    What function to use for aggregating.

    Use the aws_cloudwatch.Stats helper class to construct valid input strings.

    Can be one of the following:

    • "Minimum" | "min"
    • "Maximum" | "max"
    • "Average" | "avg"
    • "Sum" | "sum"
    • "SampleCount | "n"
    • "pNN.NN"
    • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
    • "iqm"
    • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
    • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
    • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

    Default: Average

  • unit?: Unit

    Unit used to filter the metric stream.

    Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

    The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

    CloudWatch does not honor this property for graphs.

    Default: - All metric datums in the given metric stream

  • visible?: bool

    Whether this metric should be visible in dashboard graphs.

    Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results.

    Default: true

java
public Metric metricJobCompleted()
public Metric metricJobCompleted(MetricOptions props)
csharp
private Metric MetricJobCompleted(MetricOptions Props = null)
go
func MetricJobCompleted(props MetricOptions) Metric

metricJobsMatchingMultipleProviders()metric_jobs_matching_multiple_providers()metricJobsMatchingMultipleProviders()MetricJobsMatchingMultipleProviders()MetricJobsMatchingMultipleProviders() ​

Metric for the number of jobs whose labels matched more than one provider.

We start a runner from the first matching provider, but GitHub may give such a job a runner from any of them, including one started for another job. Stolen runner detection starts another runner for the job left behind, but the job itself may run on a provider you didn't expect. Anything over zero means some workflows ask for too few labels. Add labels to those jobs so they match only one provider. Use the "Jobs matching multiple providers" CloudWatch Logs Insights query created by GitHubRunners.createLogsInsightsQueries() to find them.

Jobs routed by a provider selector are not counted, as the selector picks the provider.

WARNING: this method creates a metric filter. This resource may incur cost.

ts
public metricJobsMatchingMultipleProviders(props?: MetricOptions): Metric
python
def metric_jobs_matching_multiple_providers(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  id: str = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  stack_account: str = None,
  stack_region: str = None,
  statistic: str = None,
  unit: Unit = None,
  visible: bool = None
) -> Metric
  • account?: str

    Account which this metric comes from.

    Default: - Deployment account.

  • color?: str

    The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.

    Default: - Automatic color

  • dimensions_map?: typing.Mapping[str]

    Dimensions of the metric.

    Default: - No dimensions.

  • id?: str

    Unique identifier for this metric when used in dashboard widgets.

    The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.

    Default: - No ID

  • label?: str

    Label for this metric when added to a Graph in a Dashboard.

    You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

    [max: ${MAX}] MyMetric

    As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.

    Default: - No label

  • period?: Duration

    The period over which the specified statistic is applied.

    Default: Duration.minutes(5)

  • region?: str

    Region which this metric comes from.

    Default: - Deployment region.

  • stack_account?: str

    Account of the stack this metric is attached to.

    Default: - Deployment account.

  • stack_region?: str

    Region of the stack this metric is attached to.

    Default: - Deployment region.

  • statistic?: str

    What function to use for aggregating.

    Use the aws_cloudwatch.Stats helper class to construct valid input strings.

    Can be one of the following:

    • "Minimum" | "min"
    • "Maximum" | "max"
    • "Average" | "avg"
    • "Sum" | "sum"
    • "SampleCount | "n"
    • "pNN.NN"
    • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
    • "iqm"
    • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
    • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
    • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

    Default: Average

  • unit?: Unit

    Unit used to filter the metric stream.

    Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

    The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

    CloudWatch does not honor this property for graphs.

    Default: - All metric datums in the given metric stream

  • visible?: bool

    Whether this metric should be visible in dashboard graphs.

    Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results.

    Default: true

java
public Metric metricJobsMatchingMultipleProviders()
public Metric metricJobsMatchingMultipleProviders(MetricOptions props)
csharp
private Metric MetricJobsMatchingMultipleProviders(MetricOptions Props = null)
go
func MetricJobsMatchingMultipleProviders(props MetricOptions) Metric

metricLambdaErrors()metric_lambda_errors()metricLambdaErrors()MetricLambdaErrors()MetricLambdaErrors() ​

Metric for the number of failed invocations of the management Lambda functions.

These are the functions that handle webhooks, retrieve runner tokens, stop idle runners, replace stolen runners, etc. Anything over zero means jobs may not have gotten a runner. You should use this metric to trigger an alarm.

Only unhandled errors are counted here, as reported by Lambda itself. Errors that are handled and logged, like a webhook with a bad signature, are not failed invocations. Use the "Webhook errors" and "Orchestration errors" queries created by GitHubRunners.createLogsInsightsQueries() to find those.

Management functions created after this method is called are not included. Call it last if you use warm runners.

ts
public metricLambdaErrors(props?: MathExpressionOptions): MathExpression
python
def metric_lambda_errors(
  color: str = None,
  label: str = None,
  period: Duration = None,
  search_account: str = None,
  search_region: str = None
) -> MathExpression
  • color?: str

    Color for this metric when added to a Graph in a Dashboard.

    Default: - Automatic color

  • label?: str

    Label for this expression when added to a Graph in a Dashboard.

    If this expression evaluates to more than one time series (for example, through the use of METRICS() or SEARCH() expressions), each time series will appear in the graph using a combination of the expression label and the individual metric label. Specify the empty string ('') to suppress the expression label and only keep the metric label.

    You can use dynamic labels to show summary information about the displayed time series in the legend. For example, if you use:

    [max: ${MAX}] MyMetric

    As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend. If the math expression produces more than one time series, the maximum will be shown for each individual time series produce by this math expression.

    Default: - Expression value is used as label

  • period?: Duration

    The period over which the math expression's statistics are applied.

    This period overrides all periods in the metrics used in this math expression.

    Default: Duration.minutes(5)

  • search_account?: str

    Account to evaluate search expressions within.

    Specifying a searchAccount has no effect to the account used for metrics within the expression (passed via usingMetrics).

    Default: - Deployment account.

  • search_region?: str

    Region to evaluate search expressions within.

    Specifying a searchRegion has no effect to the region used for metrics within the expression (passed via usingMetrics).

    Default: - Deployment region.

java
public MathExpression metricLambdaErrors()
public MathExpression metricLambdaErrors(MathExpressionOptions props)
csharp
private MathExpression MetricLambdaErrors(MathExpressionOptions Props = null)
go
func MetricLambdaErrors(props MathExpressionOptions) MathExpression

metricStolenRunners()metric_stolen_runners()metricStolenRunners()MetricStolenRunners()MetricStolenRunners() ​

Metric for the number of runners that were stolen by a job that shouldn't have been assigned to them.

A high number here means your runners are shared with jobs you didn't mean to serve. Use the "Stolen runners" CloudWatch Logs Insights query created by GitHubRunners.createLogsInsightsQueries() to see which repositories and jobs are taking them.

This metric has two dimensions:

  1. Replaced which is "true" or "false" indicating whether the stolen runner was replaced. A runner may not be replaced if it was stolen too many times in a row. The current limit is 3. When this is false, there is probably a bug in our detection or something misconfigured.
  2. Provider is the provider construct path of the runner that was stolen. You can check your code to see which labels it has that may cause it to be stolen. The logs insights queries can provide even more information about the stolen runners.

WARNING: this method creates a metric filter. This resource may incur cost.

ts
public metricStolenRunners(props?: MetricOptions): Metric
python
def metric_stolen_runners(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  id: str = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  stack_account: str = None,
  stack_region: str = None,
  statistic: str = None,
  unit: Unit = None,
  visible: bool = None
) -> Metric
  • account?: str

    Account which this metric comes from.

    Default: - Deployment account.

  • color?: str

    The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.

    Default: - Automatic color

  • dimensions_map?: typing.Mapping[str]

    Dimensions of the metric.

    Default: - No dimensions.

  • id?: str

    Unique identifier for this metric when used in dashboard widgets.

    The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.

    Default: - No ID

  • label?: str

    Label for this metric when added to a Graph in a Dashboard.

    You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

    [max: ${MAX}] MyMetric

    As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.

    Default: - No label

  • period?: Duration

    The period over which the specified statistic is applied.

    Default: Duration.minutes(5)

  • region?: str

    Region which this metric comes from.

    Default: - Deployment region.

  • stack_account?: str

    Account of the stack this metric is attached to.

    Default: - Deployment account.

  • stack_region?: str

    Region of the stack this metric is attached to.

    Default: - Deployment region.

  • statistic?: str

    What function to use for aggregating.

    Use the aws_cloudwatch.Stats helper class to construct valid input strings.

    Can be one of the following:

    • "Minimum" | "min"
    • "Maximum" | "max"
    • "Average" | "avg"
    • "Sum" | "sum"
    • "SampleCount | "n"
    • "pNN.NN"
    • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
    • "iqm"
    • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
    • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
    • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

    Default: Average

  • unit?: Unit

    Unit used to filter the metric stream.

    Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

    The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

    CloudWatch does not honor this property for graphs.

    Default: - All metric datums in the given metric stream

  • visible?: bool

    Whether this metric should be visible in dashboard graphs.

    Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results.

    Default: true

java
public Metric metricStolenRunners()
public Metric metricStolenRunners(MetricOptions props)
csharp
private Metric MetricStolenRunners(MetricOptions Props = null)
go
func MetricStolenRunners(props MetricOptions) Metric

metricStoppedRunners()metric_stopped_runners()metricStoppedRunners()MetricStoppedRunners()MetricStoppedRunners() ​

Metric for the number of runners we stopped on purpose before they got a job.

These step function executions end up as aborted and not failed, so they don't show up in GitHubRunners.metricFailed().

This metric has one dimension, Reason, which is the error the step function was stopped with:

  • IdleRunner: the runner was idle for longer than its idle timeout and was reaped. This is usually a runner whose job was taken by another runner, or a job that was canceled before it started.
  • StaleWarmRunner: a warm runner was replaced because its configuration changed.
  • WarmRunnerExpired: a warm runner reached the end of its duration.
  • WarmRunnerBadDeadline: a warm runner had an invalid deadline and was stopped.

WARNING: this method creates a metric filter. This resource may incur cost.

ts
public metricStoppedRunners(props?: MetricOptions): Metric
python
def metric_stopped_runners(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  id: str = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  stack_account: str = None,
  stack_region: str = None,
  statistic: str = None,
  unit: Unit = None,
  visible: bool = None
) -> Metric
  • account?: str

    Account which this metric comes from.

    Default: - Deployment account.

  • color?: str

    The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.

    Default: - Automatic color

  • dimensions_map?: typing.Mapping[str]

    Dimensions of the metric.

    Default: - No dimensions.

  • id?: str

    Unique identifier for this metric when used in dashboard widgets.

    The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.

    Default: - No ID

  • label?: str

    Label for this metric when added to a Graph in a Dashboard.

    You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

    [max: ${MAX}] MyMetric

    As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.

    Default: - No label

  • period?: Duration

    The period over which the specified statistic is applied.

    Default: Duration.minutes(5)

  • region?: str

    Region which this metric comes from.

    Default: - Deployment region.

  • stack_account?: str

    Account of the stack this metric is attached to.

    Default: - Deployment account.

  • stack_region?: str

    Region of the stack this metric is attached to.

    Default: - Deployment region.

  • statistic?: str

    What function to use for aggregating.

    Use the aws_cloudwatch.Stats helper class to construct valid input strings.

    Can be one of the following:

    • "Minimum" | "min"
    • "Maximum" | "max"
    • "Average" | "avg"
    • "Sum" | "sum"
    • "SampleCount | "n"
    • "pNN.NN"
    • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
    • "iqm"
    • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
    • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
    • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

    Default: Average

  • unit?: Unit

    Unit used to filter the metric stream.

    Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

    The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

    CloudWatch does not honor this property for graphs.

    Default: - All metric datums in the given metric stream

  • visible?: bool

    Whether this metric should be visible in dashboard graphs.

    Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results.

    Default: true

java
public Metric metricStoppedRunners()
public Metric metricStoppedRunners(MetricOptions props)
csharp
private Metric MetricStoppedRunners(MetricOptions Props = null)
go
func MetricStoppedRunners(props MetricOptions) Metric

metricSucceeded()metric_succeeded()metricSucceeded()MetricSucceeded()MetricSucceeded() ​

Metric for successful executions.

A successful execution doesn't always mean a runner was started. It can be successful even without any label matches.

A successful runner doesn't mean the job it executed was successful. For that, see GitHubRunners.metricJobCompleted().

ts
public metricSucceeded(props?: MetricOptions): Metric
python
def metric_succeeded(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  id: str = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  stack_account: str = None,
  stack_region: str = None,
  statistic: str = None,
  unit: Unit = None,
  visible: bool = None
) -> Metric
  • account?: str

    Account which this metric comes from.

    Default: - Deployment account.

  • color?: str

    The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.

    Default: - Automatic color

  • dimensions_map?: typing.Mapping[str]

    Dimensions of the metric.

    Default: - No dimensions.

  • id?: str

    Unique identifier for this metric when used in dashboard widgets.

    The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.

    Default: - No ID

  • label?: str

    Label for this metric when added to a Graph in a Dashboard.

    You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

    [max: ${MAX}] MyMetric

    As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.

    Default: - No label

  • period?: Duration

    The period over which the specified statistic is applied.

    Default: Duration.minutes(5)

  • region?: str

    Region which this metric comes from.

    Default: - Deployment region.

  • stack_account?: str

    Account of the stack this metric is attached to.

    Default: - Deployment account.

  • stack_region?: str

    Region of the stack this metric is attached to.

    Default: - Deployment region.

  • statistic?: str

    What function to use for aggregating.

    Use the aws_cloudwatch.Stats helper class to construct valid input strings.

    Can be one of the following:

    • "Minimum" | "min"
    • "Maximum" | "max"
    • "Average" | "avg"
    • "Sum" | "sum"
    • "SampleCount | "n"
    • "pNN.NN"
    • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
    • "iqm"
    • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
    • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
    • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

    Default: Average

  • unit?: Unit

    Unit used to filter the metric stream.

    Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

    The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

    CloudWatch does not honor this property for graphs.

    Default: - All metric datums in the given metric stream

  • visible?: bool

    Whether this metric should be visible in dashboard graphs.

    Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results.

    Default: true

java
public Metric metricSucceeded()
public Metric metricSucceeded(MetricOptions props)
csharp
private Metric MetricSucceeded(MetricOptions Props = null)
go
func MetricSucceeded(props MetricOptions) Metric

metricTime()metric_time()metricTime()MetricTime()MetricTime() ​

Metric for the interval, in milliseconds, between the time the execution starts and the time it closes.

This time may be longer than the time the runner took.

ts
public metricTime(props?: MetricOptions): Metric
python
def metric_time(
  account: str = None,
  color: str = None,
  dimensions_map: typing.Mapping[str] = None,
  id: str = None,
  label: str = None,
  period: Duration = None,
  region: str = None,
  stack_account: str = None,
  stack_region: str = None,
  statistic: str = None,
  unit: Unit = None,
  visible: bool = None
) -> Metric
  • account?: str

    Account which this metric comes from.

    Default: - Deployment account.

  • color?: str

    The hex color code, prefixed with '#' (e.g. '#00ff00'), to use when this metric is rendered on a graph. The Color class has a set of standard colors that can be used here.

    Default: - Automatic color

  • dimensions_map?: typing.Mapping[str]

    Dimensions of the metric.

    Default: - No dimensions.

  • id?: str

    Unique identifier for this metric when used in dashboard widgets.

    The id can be used as a variable to represent this metric in math expressions. Valid characters are letters, numbers, and underscore. The first character must be a lowercase letter.

    Default: - No ID

  • label?: str

    Label for this metric when added to a Graph in a Dashboard.

    You can use dynamic labels to show summary information about the entire displayed time series in the legend. For example, if you use:

    [max: ${MAX}] MyMetric

    As the metric label, the maximum value in the visible range will be shown next to the time series name in the graph's legend.

    Default: - No label

  • period?: Duration

    The period over which the specified statistic is applied.

    Default: Duration.minutes(5)

  • region?: str

    Region which this metric comes from.

    Default: - Deployment region.

  • stack_account?: str

    Account of the stack this metric is attached to.

    Default: - Deployment account.

  • stack_region?: str

    Region of the stack this metric is attached to.

    Default: - Deployment region.

  • statistic?: str

    What function to use for aggregating.

    Use the aws_cloudwatch.Stats helper class to construct valid input strings.

    Can be one of the following:

    • "Minimum" | "min"
    • "Maximum" | "max"
    • "Average" | "avg"
    • "Sum" | "sum"
    • "SampleCount | "n"
    • "pNN.NN"
    • "tmNN.NN" | "tm(NN.NN%:NN.NN%)"
    • "iqm"
    • "wmNN.NN" | "wm(NN.NN%:NN.NN%)"
    • "tcNN.NN" | "tc(NN.NN%:NN.NN%)"
    • "tsNN.NN" | "ts(NN.NN%:NN.NN%)"

    Default: Average

  • unit?: Unit

    Unit used to filter the metric stream.

    Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units.

    The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all cases.

    CloudWatch does not honor this property for graphs.

    Default: - All metric datums in the given metric stream

  • visible?: bool

    Whether this metric should be visible in dashboard graphs.

    Setting this to false is useful when you want to hide raw metrics that are used in math expressions, and show only the expression results.

    Default: true

java
public Metric metricTime()
public Metric metricTime(MetricOptions props)
csharp
private Metric MetricTime(MetricOptions Props = null)
go
func MetricTime(props MetricOptions) Metric

Static Functions ​

isConstruct()is_construct()isConstruct()IsConstruct()IsConstruct() ​

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.

ts
import { GitHubRunners } from '@cloudsnorkel/cdk-github-runners'

GitHubRunners.isConstruct(x: any)
  • x: any

    Any object.

python
import cloudsnorkel.cdk_github_runners

cloudsnorkel.cdk_github_runners.GitHubRunners.is_construct(
  x: typing.Any
)
  • x: typing.Any

    Any object.

java
import com.cloudsnorkel.cdk.github.runners.GitHubRunners;

GitHubRunners.isConstruct(java.lang.Object x)
  • x: java.lang.Object

    Any object.

csharp
using CloudSnorkel;

GitHubRunners.IsConstruct(object X);
  • X: object

    Any object.

go
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"

cloudsnorkelcdkgithubrunners.GitHubRunners_IsConstruct(x interface{}) *bool
  • x: interface{}

    Any object.

Properties ​

nodenodenodeNodeNode ​

node: Node

node: Node

node: Node

Node: Node

Node: Node

The tree node.

connectionsconnectionsconnectionsConnectionsConnections ​

connections: Connections

connections: Connections

connections: Connections

Connections: Connections

Connections: Connections

Manage the connections of all management functions.

Use this to enable connections to your GitHub Enterprise Server in a VPC.

This cannot be used to manage connections of the runners. Use the connections property of each runner provider to manage runner connections.

providersprovidersprovidersProvidersProviders ​

providers: typing.List[IRunnerProvider | ICompositeProvider]

providers: java.util.List<IRunnerProvider|ICompositeProvider>

Providers: *[]interface{}

Configured runner providers.

secretssecretssecretsSecretsSecrets ​

secrets: Secrets

secrets: Secrets

secrets: Secrets

Secrets: Secrets

Secrets: Secrets

Secrets for GitHub communication including webhook secret and runner authentication.

propspropspropsPropsProps ​

Released under the Apache-2.0 License.