Skip to content

CodeBuildRunnerProviderProps Struct ​

Initializer ​

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

const codeBuildRunnerProviderProps: CodeBuildRunnerProviderProps = { ... }
python
import cloudsnorkel.cdk_github_runners

cloudsnorkel.cdk_github_runners.CodeBuildRunnerProviderProps(
  default_labels: bool = None,
  log_retention: RetentionDays = None,
  compute_type: ComputeType = None,
  docker_in_docker: bool = None,
  gpu: bool = None,
  group: str = None,
  image_builder: IRunnerImageBuilder = None,
  labels: typing.List[str] = None,
  security_groups: typing.List[ISecurityGroup] = None,
  subnet_selection: SubnetSelection = None,
  timeout: Duration = None,
  vpc: IVpc = None
)
java
import com.cloudsnorkel.cdk.github.runners.CodeBuildRunnerProviderProps;

CodeBuildRunnerProviderProps.builder()
//  .defaultLabels(java.lang.Boolean)
//  .logRetention(RetentionDays)
//  .computeType(ComputeType)
//  .dockerInDocker(java.lang.Boolean)
//  .gpu(java.lang.Boolean)
//  .group(java.lang.String)
//  .imageBuilder(IRunnerImageBuilder)
//  .labels(java.util.List<java.lang.String>)
//  .securityGroups(java.util.List<ISecurityGroup>)
//  .subnetSelection(SubnetSelection)
//  .timeout(Duration)
//  .vpc(IVpc)
    .build();
csharp
using CloudSnorkel;

new CodeBuildRunnerProviderProps {
    bool DefaultLabels = null,
    RetentionDays LogRetention = null,
    ComputeType ComputeType = null,
    bool DockerInDocker = null,
    bool Gpu = null,
    string Group = null,
    IRunnerImageBuilder ImageBuilder = null,
    string[] Labels = null,
    ISecurityGroup[] SecurityGroups = null,
    SubnetSelection SubnetSelection = null,
    Duration Timeout = null,
    IVpc Vpc = null
};
go
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"

&cloudsnorkelcdkgithubrunners.CodeBuildRunnerProviderProps {
	DefaultLabels: *bool,
	LogRetention: github.com/aws/aws-cdk-go/awscdk/v2.aws_logs.RetentionDays,
	ComputeType: github.com/aws/aws-cdk-go/awscdk/v2.aws_codebuild.ComputeType,
	DockerInDocker: *bool,
	Gpu: *bool,
	Group: *string,
	ImageBuilder: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.IRunnerImageBuilder,
	Labels: *[]*string,
	SecurityGroups: *[]github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.ISecurityGroup,
	SubnetSelection: github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.SubnetSelection,
	Timeout: github.com/aws/aws-cdk-go/awscdk/v2.Duration,
	Vpc: github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.IVpc,
}

Properties ​

defaultLabelsdefault_labelsdefaultLabelsDefaultLabelsDefaultLabels ​

defaultLabels?: boolean

default_labels?: bool

defaultLabels?: java.lang.Boolean

DefaultLabels?: bool

DefaultLabels?: *bool

Add default labels based on OS and architecture of the runner.

This will tell GitHub Runner to add default labels like self-hosted, linux, x64, and arm64.

Default: true

logRetentionlog_retentionlogRetentionLogRetentionLogRetention ​

logRetention?: RetentionDays

log_retention?: RetentionDays

logRetention?: RetentionDays

LogRetention?: RetentionDays

LogRetention?: RetentionDays

The number of days log events are kept in CloudWatch Logs.

When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to INFINITE.

Default: logs.RetentionDays.ONE_MONTH

computeTypecompute_typecomputeTypeComputeTypeComputeType ​

computeType?: ComputeType

compute_type?: ComputeType

computeType?: ComputeType

ComputeType?: ComputeType

ComputeType?: ComputeType

The type of compute to use for this build. See the ComputeType enum for the possible values.

The compute type determines CPU, memory, and disk space:

  • SMALL: 2 vCPU, 3 GB RAM, 64 GB disk
  • MEDIUM: 4 vCPU, 7 GB RAM, 128 GB disk
  • LARGE: 8 vCPU, 15 GB RAM, 128 GB disk
  • X2_LARGE: 72 vCPU, 145 GB RAM, 256 GB disk (Linux) or 824 GB disk (Windows)

Use a larger compute type when you need more disk space for building larger Docker images.

For more details, see https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html#environment.types

Default: ComputeType#SMALL

dockerInDockerdocker_in_dockerdockerInDockerDockerInDockerDockerInDocker ​

dockerInDocker?: boolean

docker_in_docker?: bool

dockerInDocker?: java.lang.Boolean

DockerInDocker?: bool

DockerInDocker?: *bool

Support building and running Docker images by enabling Docker-in-Docker (dind) and the required CodeBuild privileged mode.

Disabling this can speed up provisioning of CodeBuild runners. If you don't intend on running or building Docker images, disable this for faster start-up times.

Default: true

gpugpugpuGpuGpu ​

gpu?: boolean

gpu?: bool

gpu?: java.lang.Boolean

Gpu?: bool

Gpu?: *bool

Use GPU compute for builds.

When enabled, the default compute type is BUILD_GENERAL1_SMALL (4 vCPU, 16 GB RAM, 1 NVIDIA A10G GPU).

You can override the compute type using the computeType property (for example, to use BUILD_GENERAL1_LARGE for more resources), subject to the supported GPU compute types.

When using GPU compute, ensure your runner image includes any required GPU libraries (for example, CUDA) either by using a base image that has them preinstalled (such as an appropriate nvidia/cuda image) or by adding image components that install them. The default image builder does not automatically switch to a CUDA-enabled base image when GPU is enabled.

GPU compute is only available for Linux x64 images. Not supported on Windows or ARM.

Default: false

groupgroupgroupGroupGroup ​

group?: string

group?: str

group?: java.lang.String

Group?: string

Group?: *string

GitHub Actions runner group name.

If specified, the runner will be registered with this group name. Setting a runner group can help managing access to self-hosted runners. It requires a paid GitHub account and organization level runner registration.

The group must exist or the runner will not start.

Users will still be able to trigger this runner with the correct labels. But the runner will only be able to run jobs from repos allowed to use the group.

Default: undefined

imageBuilderimage_builderimageBuilderImageBuilderImageBuilder ​

imageBuilder?: IRunnerImageBuilder

image_builder?: IRunnerImageBuilder

imageBuilder?: IRunnerImageBuilder

ImageBuilder?: IRunnerImageBuilder

ImageBuilder?: IRunnerImageBuilder

Runner image builder used to build Docker images containing GitHub Runner and all requirements.

The image builder must contain the RunnerImageComponent.docker() component unless dockerInDocker is set to false.

The image builder determines the OS and architecture of the runner.

Default: CodeBuildRunnerProvider.imageBuilder()

labelslabelslabelsLabelsLabels ​

labels?: string[]

labels?: typing.List[str]

labels?: java.util.List<java.lang.String>

Labels?: string[]

Labels?: *[]*string

GitHub Actions labels used for this provider.

These labels are used to identify which provider should spawn a new on-demand runner. Every job sends a webhook with the labels it's looking for based on runs-on. We match the labels from the webhook with the labels specified here. If all the labels specified here are present in the job's labels, this provider will be chosen and spawn a new runner.

Default: ['codebuild']

securityGroupssecurity_groupssecurityGroupsSecurityGroupsSecurityGroups ​

securityGroups?: ISecurityGroup[]

security_groups?: typing.List[ISecurityGroup]

securityGroups?: java.util.List<ISecurityGroup>

SecurityGroups?: ISecurityGroup[]

SecurityGroups?: *[]ISecurityGroup

Security groups to assign to this instance.

Default: a new security group, if CodeBuildRunnerProviderProps.vpc is used

subnetSelectionsubnet_selectionsubnetSelectionSubnetSelectionSubnetSelection ​

subnetSelection?: SubnetSelection

subnet_selection?: SubnetSelection

subnetSelection?: SubnetSelection

SubnetSelection?: SubnetSelection

SubnetSelection?: SubnetSelection

Where to place the network interfaces within the VPC.

Default: no subnet

timeouttimeouttimeoutTimeoutTimeout ​

timeout?: Duration

timeout?: Duration

timeout?: Duration

Timeout?: Duration

Timeout?: Duration

The number of minutes after which AWS CodeBuild stops the build if it's not complete.

For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.

Default: Duration.hours(1)

vpcvpcvpcVpcVpc ​

vpc?: IVpc

vpc?: IVpc

vpc?: IVpc

Vpc?: IVpc

Vpc?: IVpc

VPC to launch the runners in.

Default: no VPC

Released under the Apache-2.0 License.