Skip to content

RunnerImageBuilderProps Struct ​

Initializer ​

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

const runnerImageBuilderProps: RunnerImageBuilderProps = { ... }
python
import cloudsnorkel.cdk_github_runners

cloudsnorkel.cdk_github_runners.RunnerImageBuilderProps(
  architecture: Architecture = None,
  aws_image_builder_options: AwsImageBuilderRunnerImageBuilderProps = None,
  base_ami: BaseImage = None,
  base_docker_image: BaseContainerImage = None,
  builder_type: RunnerImageBuilderType = None,
  code_build_options: CodeBuildRunnerImageBuilderProps = None,
  components: typing.List[RunnerImageComponent] = None,
  docker_setup_commands: typing.List[str] = None,
  log_removal_policy: RemovalPolicy = None,
  log_retention: RetentionDays = None,
  os: Os = None,
  rebuild_interval: Duration = None,
  runner_version: RunnerVersion = None,
  security_groups: typing.List[ISecurityGroup] = None,
  subnet_selection: SubnetSelection = None,
  vpc: IVpc = None,
  wait_on_deploy: bool = None
)
java
import com.cloudsnorkel.cdk.github.runners.RunnerImageBuilderProps;

RunnerImageBuilderProps.builder()
//  .architecture(Architecture)
//  .awsImageBuilderOptions(AwsImageBuilderRunnerImageBuilderProps)
//  .baseAmi(BaseImage)
//  .baseDockerImage(BaseContainerImage)
//  .builderType(RunnerImageBuilderType)
//  .codeBuildOptions(CodeBuildRunnerImageBuilderProps)
//  .components(java.util.List<RunnerImageComponent>)
//  .dockerSetupCommands(java.util.List<java.lang.String>)
//  .logRemovalPolicy(RemovalPolicy)
//  .logRetention(RetentionDays)
//  .os(Os)
//  .rebuildInterval(Duration)
//  .runnerVersion(RunnerVersion)
//  .securityGroups(java.util.List<ISecurityGroup>)
//  .subnetSelection(SubnetSelection)
//  .vpc(IVpc)
//  .waitOnDeploy(java.lang.Boolean)
    .build();
csharp
using CloudSnorkel;

new RunnerImageBuilderProps {
    Architecture Architecture = null,
    AwsImageBuilderRunnerImageBuilderProps AwsImageBuilderOptions = null,
    BaseImage BaseAmi = null,
    BaseContainerImage BaseDockerImage = null,
    RunnerImageBuilderType BuilderType = null,
    CodeBuildRunnerImageBuilderProps CodeBuildOptions = null,
    RunnerImageComponent[] Components = null,
    string[] DockerSetupCommands = null,
    RemovalPolicy LogRemovalPolicy = null,
    RetentionDays LogRetention = null,
    Os Os = null,
    Duration RebuildInterval = null,
    RunnerVersion RunnerVersion = null,
    ISecurityGroup[] SecurityGroups = null,
    SubnetSelection SubnetSelection = null,
    IVpc Vpc = null,
    bool WaitOnDeploy = null
};
go
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"

&cloudsnorkelcdkgithubrunners.RunnerImageBuilderProps {
	Architecture: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.Architecture,
	AwsImageBuilderOptions: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.AwsImageBuilderRunnerImageBuilderProps,
	BaseAmi: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.BaseImage,
	BaseDockerImage: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.BaseContainerImage,
	BuilderType: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.RunnerImageBuilderType,
	CodeBuildOptions: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.CodeBuildRunnerImageBuilderProps,
	Components: *[]github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.RunnerImageComponent,
	DockerSetupCommands: *[]*string,
	LogRemovalPolicy: github.com/aws/aws-cdk-go/awscdk/v2.RemovalPolicy,
	LogRetention: github.com/aws/aws-cdk-go/awscdk/v2.aws_logs.RetentionDays,
	Os: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.Os,
	RebuildInterval: github.com/aws/aws-cdk-go/awscdk/v2.Duration,
	RunnerVersion: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.RunnerVersion,
	SecurityGroups: *[]github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.ISecurityGroup,
	SubnetSelection: github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.SubnetSelection,
	Vpc: github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.IVpc,
	WaitOnDeploy: *bool,
}

Properties ​

architecturearchitecturearchitectureArchitectureArchitecture ​

architecture?: Architecture

architecture?: Architecture

architecture?: Architecture

Architecture?: Architecture

Architecture?: Architecture

Image architecture.

Default: Architecture.X86_64

awsImageBuilderOptionsaws_image_builder_optionsawsImageBuilderOptionsAwsImageBuilderOptionsAwsImageBuilderOptions ​

aws_image_builder_options?: AwsImageBuilderRunnerImageBuilderProps

Options specific to AWS Image Builder.

Only used when RunnerImageBuilderProps.builderType is RunnerImageBuilderType.AWS_IMAGE_BUILDER.

baseAmibase_amibaseAmiBaseAmiBaseAmi ​

baseAmi?: BaseImage

base_ami?: BaseImage

baseAmi?: BaseImage

BaseAmi?: BaseImage

BaseAmi?: BaseImage

Base AMI from which runner AMIs will be built.

This can be a BaseImage instance created using static factory methods:

For example BaseImage.fromImageBuilder(scope, 'ubuntu-server-22-lts-x86') would always use the latest version of Ubuntu 22.04 in each build. If you want a specific version, you can pass the version as the third parameter.

Default: latest Ubuntu 22.04 AMI for Os.LINUX_UBUNTU and Os.LINUX_UBUNTU_2204, Ubuntu 24.04 AMI for Os.LINUX_UBUNTU_2404, latest Amazon Linux 2 AMI for Os.LINUX_AMAZON_2, latest Windows Server 2022 AMI for Os.WINDOWS

baseDockerImagebase_docker_imagebaseDockerImageBaseDockerImageBaseDockerImage ​

baseDockerImage?: BaseContainerImage

base_docker_image?: BaseContainerImage

baseDockerImage?: BaseContainerImage

BaseDockerImage?: BaseContainerImage

BaseDockerImage?: BaseContainerImage

Base image from which Docker runner images will be built.

This can be a BaseContainerImage instance created using static factory methods:

When using private images from a different account or not on ECR, you may need to include additional setup commands with RunnerImageBuilderProps.dockerSetupCommands.

Default: public.ecr.aws/lts/ubuntu:22.04 for Os.LINUX_UBUNTU and Os.LINUX_UBUNTU_2204, public.ecr.aws/lts/ubuntu:24.04 for Os.LINUX_UBUNTU_2404, public.ecr.aws/amazonlinux/amazonlinux:2 for Os.LINUX_AMAZON_2, mcr.microsoft.com/windows/servercore:ltsc2019-amd64 for Os.WINDOWS

builderTypebuilder_typebuilderTypeBuilderTypeBuilderType ​

builder_type?: RunnerImageBuilderType

Default: CodeBuild for Linux Docker image, AWS Image Builder for Windows Docker image and any AMI

codeBuildOptionscode_build_optionscodeBuildOptionsCodeBuildOptionsCodeBuildOptions ​

Options specific to CodeBuild image builder.

Only used when RunnerImageBuilderProps.builderType is RunnerImageBuilderType.CODE_BUILD.

componentscomponentscomponentsComponentsComponents ​

components?: RunnerImageComponent[]

components?: typing.List[RunnerImageComponent]

components?: java.util.List<RunnerImageComponent>

Components?: RunnerImageComponent[]

Components?: *[]RunnerImageComponent

Components to install on the image.

Default: none

dockerSetupCommandsdocker_setup_commandsdockerSetupCommandsDockerSetupCommandsDockerSetupCommands ​

dockerSetupCommands?: string[]

docker_setup_commands?: typing.List[str]

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

DockerSetupCommands?: string[]

DockerSetupCommands?: *[]*string

Additional commands to run on the build host before starting the Docker runner image build.

Use this to execute commands such as docker login or aws ecr get-login-password to pull private base images.

Default: []

logRemovalPolicylog_removal_policylogRemovalPolicyLogRemovalPolicyLogRemovalPolicy ​

logRemovalPolicy?: RemovalPolicy

log_removal_policy?: RemovalPolicy

logRemovalPolicy?: RemovalPolicy

LogRemovalPolicy?: RemovalPolicy

LogRemovalPolicy?: RemovalPolicy

Removal policy for logs of image builds.

If deployment fails on the custom resource, try setting this to RemovalPolicy.RETAIN. This way the CodeBuild logs can still be viewed, and you can see why the build failed.

We try to not leave anything behind when removed. But sometimes a log staying behind is useful.

Default: RemovalPolicy.DESTROY

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

osososOsOs ​

os?: Os

os?: Os

os?: Os

Os?: Os

Os?: Os

Image OS.

Default: OS.LINUX_UBUNTU

rebuildIntervalrebuild_intervalrebuildIntervalRebuildIntervalRebuildInterval ​

rebuildInterval?: Duration

rebuild_interval?: Duration

rebuildInterval?: Duration

RebuildInterval?: Duration

RebuildInterval?: Duration

Schedule the image to be rebuilt every given interval.

Useful for keeping the image up-do-date with the latest GitHub runner version and latest OS updates.

Set to zero to disable.

Default: Duration.days(7)

runnerVersionrunner_versionrunnerVersionRunnerVersionRunnerVersion ​

runnerVersion?: RunnerVersion

runner_version?: RunnerVersion

runnerVersion?: RunnerVersion

RunnerVersion?: RunnerVersion

RunnerVersion?: RunnerVersion

Version of GitHub Runners to install.

Default: latest version available

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.

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

vpcvpcvpcVpcVpc ​

vpc?: IVpc

vpc?: IVpc

vpc?: IVpc

Vpc?: IVpc

Vpc?: IVpc

VPC to build the image in.

Default: no VPC

waitOnDeploywait_on_deploywaitOnDeployWaitOnDeployWaitOnDeploy ​

waitOnDeploy?: boolean

wait_on_deploy?: bool

waitOnDeploy?: java.lang.Boolean

WaitOnDeploy?: bool

WaitOnDeploy?: *bool

Wait for image to finish building during deployment.

It's usually best to leave this enabled to ensure everything is ready once deployment is done. However, it can be disabled to speed up deployment in case where you have a lot of image components that can take a long time to build.

Disabling this option means a finished deployment is not ready to be used. You will have to wait for the image to finish building before the system can be used.

Disabling this option may also mean any changes to settings or components can take up to a week (default rebuild interval) to take effect.

Default: true

Released under the Apache-2.0 License.