Ec2RunnerProviderProps Struct
Properties for Ec2RunnerProvider construct.
Initializer
import { Ec2RunnerProviderProps } from '@cloudsnorkel/cdk-github-runners'
const ec2RunnerProviderProps: Ec2RunnerProviderProps = { ... }import cloudsnorkel.cdk_github_runners
cloudsnorkel.cdk_github_runners.Ec2RunnerProviderProps(
default_labels: bool = None,
log_retention: RetentionDays = None,
group: str = None,
image_builder: IRunnerImageBuilder = None,
instance_type: InstanceType = None,
labels: typing.List[str] = None,
security_groups: typing.List[ISecurityGroup] = None,
spot: bool = None,
spot_max_price: str = None,
storage_options: StorageOptions = None,
storage_size: Size = None,
subnet_selection: SubnetSelection = None,
tags: typing.Mapping[str] = None,
vpc: IVpc = None
)import com.cloudsnorkel.cdk.github.runners.Ec2RunnerProviderProps;
Ec2RunnerProviderProps.builder()
// .defaultLabels(java.lang.Boolean)
// .logRetention(RetentionDays)
// .group(java.lang.String)
// .imageBuilder(IRunnerImageBuilder)
// .instanceType(InstanceType)
// .labels(java.util.List<java.lang.String>)
// .securityGroups(java.util.List<ISecurityGroup>)
// .spot(java.lang.Boolean)
// .spotMaxPrice(java.lang.String)
// .storageOptions(StorageOptions)
// .storageSize(Size)
// .subnetSelection(SubnetSelection)
// .tags(java.util.Map<java.lang.String, java.lang.String>)
// .vpc(IVpc)
.build();using CloudSnorkel;
new Ec2RunnerProviderProps {
bool DefaultLabels = null,
RetentionDays LogRetention = null,
string Group = null,
IRunnerImageBuilder ImageBuilder = null,
InstanceType InstanceType = null,
string[] Labels = null,
ISecurityGroup[] SecurityGroups = null,
bool Spot = null,
string SpotMaxPrice = null,
StorageOptions StorageOptions = null,
Size StorageSize = null,
SubnetSelection SubnetSelection = null,
System.Collections.Generic.IDictionary<string, string> Tags = null,
IVpc Vpc = null
};import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"
&cloudsnorkelcdkgithubrunners.Ec2RunnerProviderProps {
DefaultLabels: *bool,
LogRetention: github.com/aws/aws-cdk-go/awscdk/v2.aws_logs.RetentionDays,
Group: *string,
ImageBuilder: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.IRunnerImageBuilder,
InstanceType: github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.InstanceType,
Labels: *[]*string,
SecurityGroups: *[]github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.ISecurityGroup,
Spot: *bool,
SpotMaxPrice: *string,
StorageOptions: github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners.StorageOptions,
StorageSize: github.com/aws/aws-cdk-go/awscdk/v2.Size,
SubnetSelection: github.com/aws/aws-cdk-go/awscdk/v2.aws_ec2.SubnetSelection,
Tags: *map[string]*string,
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
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 AMI containing GitHub Runner and all requirements.
The image builder determines the OS and architecture of the runner.
Default: Ec2RunnerProvider.imageBuilder()
instanceTypeinstance_typeinstanceTypeInstanceTypeInstanceType
instanceType?: InstanceType
instance_type?: InstanceType
instanceType?: InstanceType
InstanceType?: InstanceType
InstanceType?: InstanceType
Instance type for launched runner instances.
For GPU instance types (g4dn, g5, p3, etc.), we automatically use a GPU base image (AWS Deep Learning AMI) with NVIDIA drivers pre-installed. If you provide your own image builder, use baseAmi: BaseImage.fromGpuBase(os, architecture) or another image preloaded with NVIDIA drivers, or use an image component to install NVIDIA drivers.
Default: m6i.large
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: ['ec2']
securityGroupssecurity_groupssecurityGroupsSecurityGroupsSecurityGroups
securityGroups?: ISecurityGroup[]
security_groups?: typing.List[ISecurityGroup]
securityGroups?: java.util.List<ISecurityGroup>
SecurityGroups?: ISecurityGroup[]
SecurityGroups?: *[]ISecurityGroup
Security groups to assign to launched runner instances.
Default: a new security group
spotspotspotSpotSpot
spot?: boolean
spot?: bool
spot?: java.lang.Boolean
Spot?: bool
Spot?: *bool
Use spot instances to save money.
Spot instances are cheaper but not always available and can be stopped prematurely.
Default: false
spotMaxPricespot_max_pricespotMaxPriceSpotMaxPriceSpotMaxPrice
spotMaxPrice?: string
spot_max_price?: str
spotMaxPrice?: java.lang.String
SpotMaxPrice?: string
SpotMaxPrice?: *string
Set a maximum price for spot instances.
Default: no max price (you will pay current spot price)
storageOptionsstorage_optionsstorageOptionsStorageOptionsStorageOptions
storageOptions?: StorageOptions
storage_options?: StorageOptions
storageOptions?: StorageOptions
StorageOptions?: StorageOptions
StorageOptions?: StorageOptions
Options for runner instance storage volume.
storageSizestorage_sizestorageSizeStorageSizeStorageSize
storageSize?: Size
storage_size?: Size
storageSize?: Size
StorageSize?: Size
StorageSize?: Size
Size of volume available for launched runner instances.
This modifies the boot volume size and doesn't add any additional volumes.
Default: 30GB
subnetSelectionsubnet_selectionsubnetSelectionSubnetSelectionSubnetSelection
subnetSelection?: SubnetSelection
subnet_selection?: SubnetSelection
subnetSelection?: SubnetSelection
SubnetSelection?: SubnetSelection
SubnetSelection?: SubnetSelection
Where to place the network interfaces within the VPC.
Only the first matched subnet will be used.
Default: default VPC subnet
tagstagstagsTagsTags
tags?: {[ key: string ]: string}
tags?: typing.Mapping[str]
tags?: java.util.Map<java.lang.String, java.lang.String>
Tags?: System.Collections.Generic.IDictionary<string, string>
Tags?: *map[string]*string
Additional tags to apply to launched runner instances and their volumes.
These additional tags are set on top of Name, GitHubRunners:Provider, GitHubRunners:Repo, and GitHubRunners:Labels, and GitHubRunners:Runner. You may only override Name. Tags prefixed GitHubRunners: are reserved and rejected. Some of our reserved tags are used for house-keeping purposes.
Default: no additional tags
vpcvpcvpcVpcVpc
vpc?: IVpc
vpc?: IVpc
vpc?: IVpc
Vpc?: IVpc
Vpc?: IVpc
VPC where runner instances will be launched.
Default: default account VPC