UNPKG

@cloudgardener/cdk-aws-fargate-github-actions-runner

Version:

CDK construct library to deploy GitHub Actions self-hosted runner to AWS Fargate.

50 lines (49 loc) 1.4 kB
import { aws_ec2 as ec2, aws_ecs as ecs, aws_iam as iam } from "aws-cdk-lib"; import { Construct } from "constructs"; /** * Properties of the GithubActionsRunner */ export interface GithubActionsRunnerProps { /** * The VPC to run the cluster in * @default - a new VPC is created */ readonly vpc?: ec2.IVpc; /** * The ECS cluster to run the task in * @default - a new cluster is created */ readonly cluster?: ecs.ICluster; /** * Secret containing * a GitHub Personal Access Token to be used * for the runner authentication */ readonly githubToken: ecs.Secret; /** * The GitHub repository to use for the runner * @example "https://github.com/cloudgardener/runner-demo" */ readonly runnerContext: string; /** * How long to store the GitHub runner logs * @default - 7 days */ readonly logRetentionDays?: number; /** * Use Fargate SPOT capacity * @default - true */ readonly useSpotCapacity?: boolean; } export declare class GithubActionsRunner extends Construct implements ec2.IConnectable { /** * Makes runner "connectable" */ readonly connections: ec2.Connections; /** * The IAM role associated with this runner */ readonly role: iam.IRole; constructor(scope: Construct, id: string, props: GithubActionsRunnerProps); }