This Terraform module creates a GitHub repo and projects. Using this module in automation with Consul Terraform Sync (CTS) will dynamically create or delete GitHub projects based off of configured services. This module is useful for testing CTS with a provider that supports multiple accounts without setting up infrastructure.
The module uses the github
Terraform provider to create a repository named 'cts-labels' in the configured GitHub account. It then creates GitHub projects within the repository. The projects are named after the monitored Consul service instances and project description is various service information.
Ecosystem | Version |
---|---|
consul | >= 1.7 |
consul-terraform-sync | >= 0.1.0 |
terraform | >= 0.13 |
Name | Version |
---|---|
github | >= 4.5.2 |
A GitHub personal access token is required in order to use this module:
- Create a GitHub account
- Create a personal access token in GitHub
User Config for Consul Terraform Sync
See Securely Configure Terraform Providers for alternatives to directly inserting token in config file.
example.hcl
task {
name = "task_b"
services = ["api"]
providers = ["github"]
version = "0.0.1"
source = "lornasong/cts_project/github"
}
terraform_provider "github" {
token = "<GIT PERSONAL ACCESS TOKEN>"
}