Skip to content

mncherian/terraform-github-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

terraform-github-matrix

A Terraform module to create multiple GitHub repositories based on combinations of resources, environments, and regions. This naming convention follows the recommended approach detailed in the HCP Terraform documentation (with an optional prefix for flexibility). This module creates a total number of resources * environments * regions repositories.

Requirements

Name Version
terraform >= 1.0
github = 6.6.0

Providers

Name Version
github 6.6.0

Usage

module "matrix" {
  source       = "github.com/mncherian/terraform-github-matrix"
  github_owner = "your-github-org"
  prefix       = "org-"
  resources    = ["networking", "monitoring"]
  environments = ["staging", "prod"]
  regions      = ["us-east", "eu-central"]
  # template = {
  #   owner      = "your-github-org"
  #   repository = "your-template-repo"
  # }
}

Example Repositories

The following repositories would be created based of the example shown above:

  • org-networking-staging-us-east
  • org-networking-staging-eu-central
  • org-networking-prod-us-east
  • org-networking-prod-eu-central
  • org-monitoring-staging-us-east
  • ...

Inputs

Name Description Type Default Required
github_owner GitHub organization or user name. string n/a Yes
prefix Prefix to prepend to each repository name. string "" No
resources List of resources. list(string) ["networking", "monitoring"] No
environments List of environments. list(string) ["staging", "prod"] No
regions List of regions. list(string) [] No
template Optional object specifying a GitHub template repository to use for all created repositories. object({ owner = string, repository = string }) null No

Outputs

Name Description
repository_names List of created GitHub repository names.

License

This module is licensed under the Apache License 2.0.

About

Terraform module to create infrastructure repositories.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages