Skip to content

POC to integrate Github Actions and AWS EC2 with Github OIDC

Notifications You must be signed in to change notification settings

amartingarcia/github-runner-aws-ec2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-runner-aws-ec2

This repository allows you to configure an AWS account and a GitHub repository to create an AWS EC2 Instance and use it as a GitHub runner during the execution of the Workflow, using the action aws-actions/configure-aws-credentials:

This demo covers two cases: authentication with AWS via Access Key and Secret Key, and authentication with OIDC.

In both cases, you will first need a GitHub PAT with full repo permissions.

Next, create a terraform.tfvars file in the terraform directory with the following details:

region            = "" # AWS region
access_key        = "" # Access key of an admin user in AWS
secret_key        = "" # Secret key of an admin user in AWS
github_repository = "" # Name of the GitHub repository
github_token      = "" # PAT for your repository with repo scope
aws_subnet_id     = "" # Subnet ID where you will deploy your runners
vpc_id            = "" # VPC ID where you want to deploy your runners

The links I used as a reference are as follows:

Check the files:

Also, review the Terraform files. Afterward, run terraform apply.

Once applied, add the changes to your repository and check that both pipelines are running correctly.

Access key y Secret key

Start instance

Ec2 console

Run command

Stop instance

Con OIDC

Start instance

Ec2 console

Run command

Stop instance

About

POC to integrate Github Actions and AWS EC2 with Github OIDC

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages