This Terraform module enables you to configure GitHub Actions as an AWS IAM OIDC identity provider in AWS, which enables GitHub Actions to access resources within an AWS account(s) without requiring long-lived credentials to be stored as GitHub secrets.
- AWS Account(s) and credentials
- GitHub repository
- Terraform >= 1.x
- ...
- Profit?
provider "aws" {
region = var.region
}
module "github_oidc" {
source = "saidsef/github-oidc/aws"
version = "~> 2"
attach_read_only_policy = true
github_organisation = "saidsef"
github_repositories = [{
name = "terraform-aws-github-oidc",
branches = ["main", "pr-*", "*pull*", "*"]
}]
tags = var.tags
}
Please see TERRAFORM.md
Retrieve temporary credentials:
terraform-aws-github-oidc/.github/workflows/ci.yaml
Lines 80 to 96 in 89b5f02
Our latest and greatest source of terraform-aws-github-oidc
can be found on GitHub. Fork us!
We would ❤️ you to contribute by making a pull request.
Please read the official Contribution Guide for more information on how you can contribute.