Skip to content

Terraform module to configure GitHub Actions as an IAM OIDC identity provider in AWS

License

Notifications You must be signed in to change notification settings

fossabot/terraform-aws-github-oidc

 
 

Repository files navigation

Terraform AWS GitHub OIDC Provider

CI GitHub issues License FOSSA Status

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.

Prerequisites

  • AWS Account(s) and credentials
  • GitHub repository
  • Terraform >= 1.x
  • Profit?

Deployment / Usage

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
}

Provider Specifications and Requirements

Please see TERRAFORM.md

GitHub Actions

Retrieve temporary credentials:

https://github.com/saidsef/terraform-aws-github-oidc/blob/29d6020587d06986388d84b2d10cbe266a1ea484/.github/workflows/ci.yaml#L79-L94

Source

Our latest and greatest source of terraform-aws-github-oidc can be found on GitHub. Fork us!

Contributing

We would ❤️ you to contribute by making a pull request.

Please read the official Contribution Guide for more information on how you can contribute.

License

FOSSA Status

About

Terraform module to configure GitHub Actions as an IAM OIDC identity provider in AWS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 100.0%