https://github.com/nodesource/aws-eco-runner
Automate the management of your GitHub Actions runner on AWS to minimize costs
https://github.com/nodesource/aws-eco-runner
Last synced: 9 months ago
JSON representation
Automate the management of your GitHub Actions runner on AWS to minimize costs
- Host: GitHub
- URL: https://github.com/nodesource/aws-eco-runner
- Owner: nodesource
- License: mit
- Created: 2024-05-17T15:59:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-29T21:05:08.000Z (over 1 year ago)
- Last Synced: 2025-04-03T04:02:04.430Z (10 months ago)
- Language: JavaScript
- Size: 624 KB
- Stars: 9
- Watchers: 4
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AWS Eco Runner
Automate the management of your GitHub Actions runner on AWS to minimize costs
## Overview
**AWS Eco Runner** is a solution designed to optimize the cost of using GitHub Actions runners on AWS. By automating the activation and deactivation of the instance, it ensures that you only incur costs when necessary.
The runner is kept active every 2 days (to not be removed as a Github Runner) and turned off when not in use, providing a cost-effective approach to managing GitHub Actions workflows.
## Usage
```yaml
steps:
# Configure AWS Credentials
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: $ARN_IAM_ROLE
- name: Start Runner
uses: nodesource/aws-eco-runner@v1
with:
instance_id: '["i-01", "i-02"]'
action: 'start'
aws_default_region: 'us-west-2'
...
- name: Stop Runner
uses: nodesource/aws-eco-runner@v1
with:
instance_id: '["i-01"]'
action: 'stop'
aws_default_region: 'us-west-2'
```
This action requires a minimal permission to start and stop the instance:
This is an example IAM policy, you must adapt it to your needs.
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": ["ec2:StartInstances", "ec2:StopInstances"],
"Resource": ["arn:aws:ec2:${REGION}:${ACCOUNT_ID}:instance/${INSTANCE_ID}"]
}
]
}
```