GitlabContainerRunner Construct for create a Gitlab Runner.
import { GitlabContainerRunner } from 'cdk-gitlab-runner'
new GitlabContainerRunner(scope: Construct, id: string, props: GitlabContainerRunnerProps)
- Type:
constructs.Construct
- Type:
string
public createUserData(props: GitlabContainerRunnerProps, tokenParameterStoreName: string)
- Type:
string
the tokenParameterStoreName to put gitlab runner token.
public expireAfter(duration: Duration)
- Type:
aws-cdk-lib.Duration
Block duration.
public readonly defaultRunnerSG: ISecurityGroup;
The EC2 runner's default SecurityGroup.
public readonly runnerEc2: IInstance;
This represents a Runner EC2 instance , !!! only support On-demand runner instance !!!
public readonly runnerRole: IRole;
The IAM role assumed by the Runner instance .
public readonly spotFleetInstanceId: string;
- Type:
string
the first instance id in this fleet , !!! only support spotfleet runner !!!
public readonly spotFleetRequestId: string;
- Type:
string
SpotFleetRequestId for this spot fleet , !!! only support spotfleet runner !!!
public readonly vpc: IVpc;
- Type:
aws-cdk-lib.aws_ec2.IVpc
The EC2 runner's vpc.
GitlabRunnerAutoscaling Construct for create Autoscaling Gitlab Runner.
import { GitlabRunnerAutoscaling } from 'cdk-gitlab-runner'
new GitlabRunnerAutoscaling(scope: Construct, id: string, props: GitlabRunnerAutoscalingProps)
- Type:
constructs.Construct
- Type:
string
public createUserData(props: GitlabRunnerAutoscalingProps)
public readonly autoscalingGroup: AutoScalingGroup;
This represents a Runner Auto Scaling Group.
public readonly instanceRole: IRole;
The IAM role assumed by the Runner instance.
public readonly securityGroup: ISecurityGroup;
The EC2 runner's default SecurityGroup.
public readonly topicAlarm: ITopic;
The SNS topic to suscribe alarms for EC2 runner's metrics.
public readonly vpc: IVpc;
- Type:
aws-cdk-lib.aws_ec2.IVpc
The EC2 runner's VPC.
Docker Volumes interface.
import { DockerVolumes } from 'cdk-gitlab-runner'
const dockerVolumes: DockerVolumes = { ... }
public readonly containerPath: string;
- Type:
string
Job Runtime Container Path Host Path.
public readonly hostPath: string;
- Type:
string
EC2 Runner Host Path.
GitlabContainerRunner Props.
import { GitlabContainerRunnerProps } from 'cdk-gitlab-runner'
const gitlabContainerRunnerProps: GitlabContainerRunnerProps = { ... }
public readonly gitlabRunnerVersion: string;
- Type:
string
Gitlab Runner version Please give me gitlab runner version.
public readonly gitlabtoken: string;
- Type:
string
- Default: You must to give the token !!!
Gitlab token for the Register Runner .
public readonly concurrentJobs: number;
- Type:
number
- Default: concurrentJobs=1
Gitlab Runner concurrent job configuration.
public readonly dockerVolumes: DockerVolumes[];
- Type:
cdk-gitlab-runner.DockerVolumes
[] - Default: already mount "/var/run/docker.sock:/var/run/docker.sock"
add another Gitlab Container Runner Docker Volumes Path at job runner runtime.
more detail see https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersdocker-section
public readonly ebsSize: number;
- Type:
number
- Default: ebsSize=60
Gitlab Runner instance EBS size .
public readonly ec2iamrole: IRole;
- Type:
aws-cdk-lib.aws_iam.IRole
- Default: new Role for Gitlab Runner Instance , attach AmazonSSMManagedInstanceCore Policy .
IAM role for the Gitlab Runner Instance .
public readonly ec2type: string;
- Type:
string
- Default: t3.micro
Runner default EC2 instance type.
public readonly enabledIMDSv2: boolean;
- Type:
boolean
- Default: false
Enabled IMDSv2.
more detail see https://docs.aws.amazon.com/zh_tw/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
public readonly gitlabRunnerImage: string;
- Type:
string
- Default: public.ecr.aws/gitlab/gitlab-runner:latest !!! <--- latest now > 16.0 Gitlab Runner version
Image URL of Gitlab Runner.
public readonly gitlaburl: string;
- Type:
string
- Default: gitlaburl='https://gitlab.com/' , please use https://yourgitlab.com/ do not use https://yourgitlab.com
Gitlab Runner register url .
public readonly instanceInterruptionBehavior: InstanceInterruptionBehavior;
- Type:
cdk-gitlab-runner.InstanceInterruptionBehavior
- Default: InstanceInterruptionBehavior.TERMINATE , !!! only support spotfleet runner !!! .
The behavior when a Spot Runner Instance is interrupted.
public readonly keyName: string;
- Type:
string
- Default: no ssh key will be assigned , !!! only support spotfleet runner !!! .
SSH key name.
public readonly runnerDescription: string;
- Type:
string
- Default: runnerDescription='Docker Runner'
Gitlab Runner description.
public readonly selfvpc: IVpc;
- Type:
aws-cdk-lib.aws_ec2.IVpc
- Default: new VPC will be created , 1 Vpc , 2 Public Subnet .
VPC for the Gitlab Runner .
public readonly spotFleet: boolean;
- Type:
boolean
- Default: spotFleet=false
Gitlab Runner instance Use Spot Fleet or not ?!.
public readonly tags: string[];
- Type:
string
[] - Default: ['runner', 'gitlab', 'awscdk']
tags for the runner Unsupported Gitlab Runner 15.10 and later.
public readonly validUntil: string;
- Type:
string
- Default: no expiration , !!! only support spotfleet runner !!! .
the time when the spot fleet allocation expires.
public readonly vpcSubnet: SubnetSelection;
- Type:
aws-cdk-lib.aws_ec2.SubnetSelection
- Default: public subnet
VPC subnet for the spot fleet.
GitlabRunnerAutoscaling Props.
import { GitlabRunnerAutoscalingProps } from 'cdk-gitlab-runner'
const gitlabRunnerAutoscalingProps: GitlabRunnerAutoscalingProps = { ... }
public readonly gitlabRunnerVersion: string;
- Type:
string
Gitlab Runner version Please give me gitlab runner version.
public readonly gitlabToken: string;
- Type:
string
Gitlab token.
public readonly alarms: object[];
- Type:
object
[] - Default: [{ AlarmName: 'GitlabRunnerDiskUsage', MetricName: 'disk_used_percent', }]
Parameters of put_metric_alarm function.
public readonly desiredCapacity: number;
- Type:
number
- Default: minCapacity, and leave unchanged during deployment
Desired capacity limit for autoscaling group.
public readonly dockerVolumes: DockerVolumes[];
- Type:
cdk-gitlab-runner.DockerVolumes
[] - Default: already mount "/var/run/docker.sock:/var/run/docker.sock"
add another Gitlab Container Runner Docker Volumes Path at job runner runtime.
more detail see https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnersdocker-section
public readonly ebsSize: number;
- Type:
number
- Default: ebsSize=60
Gitlab Runner instance EBS size .
public readonly gitlabRunnerImage: string;
- Type:
string
- Default: public.ecr.aws/gitlab/gitlab-runner:latest
Image URL of Gitlab Runner.
public readonly gitlabUrl: string;
- Type:
string
- Default: https://gitlab.com/ , The trailing slash is mandatory.
Gitlab Runner register url .
public readonly instanceRole: IRole;
- Type:
aws-cdk-lib.aws_iam.IRole
- Default: new Role for Gitlab Runner Instance , attach AmazonSSMManagedInstanceCore Policy .
IAM role for the Gitlab Runner Instance .
public readonly instanceType: string;
- Type:
string
- Default: t3.micro
Runner default EC2 instance type.
public readonly maxCapacity: number;
- Type:
number
- Default: desiredCapacity
Maximum capacity limit for autoscaling group.
public readonly minCapacity: number;
- Type:
number
- Default: minCapacity: 1
Minimum capacity limit for autoscaling group.
public readonly spotInstance: boolean;
- Type:
boolean
- Default: false
Run worker nodes as EC2 Spot.
public readonly tags: string[];
- Type:
string
[] - Default: ['runner', 'gitlab', 'awscdk']
tags for the runner.
public readonly vpc: IVpc;
- Type:
aws-cdk-lib.aws_ec2.IVpc
- Default: A new VPC will be created.
VPC for the Gitlab Runner .
public readonly vpcSubnet: SubnetSelection;
- Type:
aws-cdk-lib.aws_ec2.SubnetSelection
- Default: SubnetType.PRIVATE subnet
VPC subnet.
InstanceInterruptionBehavior enum.
hibernate.
stop.
terminate.