Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions .github/workflows/snyk.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ terraform.tfvars
/runner-id
/registered-runners.json
/errors.log
.DS_Store
24 changes: 0 additions & 24 deletions .snyk

This file was deleted.

60 changes: 49 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,38 @@
# [terraform-aws-arc-github-runner](https://github.com/sourcefuse/terraform-aws-arc-github-runner)

[![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=sourcefuse_terraform-aws-arc-github-runner)](https://sonarcloud.io/summary/new_code?id=sourcefuse_terraform-aws-arc-github-runner)
> **Module:** `sourcefuse/arc-github-runner/aws`

> **Registry:** [https://registry.terraform.io/modules/sourcefuse/arc-github-runner/aws](https://registry.terraform.io/modules/sourcefuse/arc-github-runner/aws)

> **Category:** DevOps / CI/CD

> **Source:** [https://github.com/sourcefuse/terraform-aws-arc-github-runner](https://github.com/sourcefuse/terraform-aws-arc-github-runner)

[![Known Vulnerabilities](https://github.com/sourcefuse/terraform-refarch-github-runner/actions/workflows/snyk.yaml/badge.svg)](https://github.com/sourcefuse/terraform-refarch-github-runner/actions/workflows/snyk.yaml)
[![Latest Release](https://img.shields.io/github/release/sourcefuse/terraform-aws-arc-github-runner.svg?style=for-the-badge)](https://github.com/sourcefuse/terraform-aws-arc-github-runner/releases/latest)
[![Last Updated](https://img.shields.io/github/last-commit/sourcefuse/terraform-aws-arc-github-runner.svg?style=for-the-badge)](https://github.com/sourcefuse/terraform-aws-arc-github-runner/commits)
![Terraform](https://img.shields.io/badge/terraform-%235835CC.svg?style=for-the-badge&logo=terraform&logoColor=white)
![GitHub Actions](https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge&logo=githubactions&logoColor=white)

[![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=sourcefuse_terraform-aws-arc-github-runner)](https://sonarcloud.io/summary/new_code?id=sourcefuse_terraform-aws-arc-github-runner)

## Overview

SourceFuse AWS Reference Architecture (ARC) Terraform module for managing GitHub Runner.
Deploys a self-hosted GitHub Actions runner on an EC2 instance with auto-registration, SSM access, and configurable labels.

This module will create the following resources in a specified AWS Account:
* S3 bucket: used for storing the generated `docker-compose.yml`
* EC2 instance: Used for running the runner container on
* SSH Key Pair: Used for decrypting EC2 password
* SSM Documents: Used for installing dependencies and updating the SSM Agent
* IAM Policies: For accessing created resources
* SSM Parameter: For storing the runner token
## What It Does

- EC2-based self-hosted GitHub Actions runner
- Automatic runner registration with GitHub token
- Configurable runner labels for job targeting
- SSM Session Manager access (no SSH required)
- IAM instance profile with configurable policies
- VPC and security group configuration

This module utilizes different `local-exec` provisioners to execute scripts for obtaining the needed GitHub Runner token
and remove the runner from the organization when the resources are destroyed.
See [Pre-Requisites](#pre-requisites) for information on the needed permissions these scripts will require.

### Pre-Requisites
## Pre-Requisites
You will need to have a GitHub Personal Access Token (PAT) with `admin:org` permissions in order to manage GitHub runners for the Organization.
If you do not have sufficient permissions to GitHub, the runner will not register.

Expand All @@ -39,6 +51,8 @@ When choosing an AMI, please be sure to select either **Ubuntu** or **Debian**.

To see a full example, check out the [main.tf](https://github.com/sourcefuse/terraform-aws-arc-github-runner/blob/main/example/main.tf) file in the example folder.

## Quickstart

```hcl
module "runner" {
source = "sourcefuse/arc-github-runner/aws"
Expand All @@ -56,6 +70,26 @@ module "runner" {
}
```

## Required Inputs

| Name | Type | Description |
|------|------|-------------|
| `namespace` | `string` | Namespace prefix |
| `environment` | `string` | Deployment environment |
| `subnet_id` | `string` | Subnet ID for the runner EC2 instance |
| `vpc_id` | `string` | VPC ID |
| `github_token` | `string` | GitHub PAT or registration token |
| `runner_labels` | `string` | Comma-separated runner labels |
## Key Outputs

| Name | Description |
|------|-------------|
| `instance_id` | EC2 instance ID of the runner |
| `instance_private_ip` | Private IP of the runner |
## Full Variable & Output Reference

The complete inputs/outputs reference is auto-generated below.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

Expand Down Expand Up @@ -187,6 +221,10 @@ By specifying this , it will bump the version and if you dont specify this in yo
go test -timeout 30m
```

## Contributing

See [CONTRIBUTING.md](./CONTRIBUTING.md) for commit conventions and development setup.

## Authors

This project is authored by:
Expand Down
Loading