CDK app that, given an existing GitHub repository, attaches a repository webhook that triggers self-hosted runners in AWS CodeBuild when workflow jobs are queued.
- cdktf-aws-codebuild-github-runners - Built with CDKTF instead of AWS CDK.
- cdktf-aws-codebuild-github-runners-organization - Built with CDKTF instead of AWS CDK; uses a GitHub organization webhook instead of repository webhook.
- AWS:
- Must have authenticated with Default Credentials in your local environment.
- Must have completed the CDK bootstrapping for the target AWS environment.
- GitHub:
- Must have created a GitHub repository in your personal account.
- Must have set the
GITHUB_TOKEN
,GITHUB_OWNER
andGITHUB_REPO
variables in your local environment.
- Node.js + npm:
- Must be installed in your system.
npx projen install
npx projen deploy
-
Grab the
<GHA_RUNNER_LABEL>
from the deployment outputs:GhaRunnerLabel = <GHA_RUNNER_LABEL>
-
Create a new GitHub Actions workflow and specify the runner:
runs-on: <GHA_RUNNER_LABEL>
-
Commit and push your workflow file to the repository.
-
Your workflow will be enqueued and run on an ephemeral EC2 instance managed by AWS CodeBuild.
npx projen destroy