Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tbobm/terraform-github-secrets
Terraform module to manage Github Repository Secrets and Github Actions Environment Secrets.
https://github.com/tbobm/terraform-github-secrets
github github-actions secrets terraform terraform-module
Last synced: 3 days ago
JSON representation
Terraform module to manage Github Repository Secrets and Github Actions Environment Secrets.
- Host: GitHub
- URL: https://github.com/tbobm/terraform-github-secrets
- Owner: tbobm
- Created: 2021-12-04T12:07:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-05T09:48:43.000Z (about 2 years ago)
- Last Synced: 2023-03-04T01:37:29.565Z (over 1 year ago)
- Topics: github, github-actions, secrets, terraform, terraform-module
- Language: HCL
- Homepage: https://registry.terraform.io/modules/tbobm/secrets/github/latest
- Size: 35.2 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
Awesome Lists containing this project
README
# terraform-github-secrets
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/terraform-github-secrets)
[![terraform-github-secrets](https://github.com/tbobm/terraform-github-secrets/workflows/terraform-github-secrets/badge.svg)](https://github.com/tbobm/terraform-github-secrets/actions?query=workflow%3Aterraform-github-secrets)Terraform module to manage Github Repository Secrets and Github Actions Environment Secrets.
## Doc generation
Code formatting and documentation for variables and outputs is generated using
[pre-commit-terraform
hooks](https://github.com/antonbabenko/pre-commit-terraform) which uses
[terraform-docs](https://github.com/segmentio/terraform-docs).Follow [these
instructions](https://github.com/antonbabenko/pre-commit-terraform#how-to-install)
to install pre-commit locally.And install `terraform-docs` with `go get github.com/segmentio/terraform-docs`
or `brew install terraform-docs`.## Contributing
Report issues/questions/feature requests on in the
[issues](https://github.com/tbobm/terraform-github-secrets/issues/new)
section.Full contributing [guidelines are covered
here](https://github.com/tbobm/terraform-github-secrets/blob/master/.github/CONTRIBUTING.md).## Usage
### Github Authentication
You will need to authenticate against Github using an OAuth Token or Personal Access Token.
See [Github Provider#Authentication][tf-gh-auth] for more informations.This can be done by setting the `token` argument of the `github` provider or by exporting
your Token to the `GITHUB_TOKEN` environment variable._Provider configuration:_
```hcl
provider "github" {
token = var.token # or `GITHUB_TOKEN`
}
```_Environment variable configuration:_
```bash
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```[tf-gh-auth]: https://registry.terraform.io/providers/integrations/github/latest/docs#authentication
### Example
```hcl
module "secrets" {
source = "../"repository = "tbobm/terraform-github-secrets"
secrets = {
deploy_key = {
name = "DEPLOY_KEY"
plaintext = "ABCDEF"
}
registry_username = {
name = "DOCKERHUB_USERNAME"
plaintext = "sampleuser"
}
registry_password = {
name = "DOCKERHUB_PASSWORD"
plaintext = "samplepass"
}
}
environment_secrets = {
production = { # the production env must exist beforehand
ssh_username = {
name = "SSH_USERNAME"
plaintext = "sampleuser"
}
ssh_password = {
name = "SSH_PASSWORD"
plaintext = "samplepass"
}
}
}
}
```## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.15 |
| [github](#requirement\_github) | ~> 4 |## Providers
| Name | Version |
|------|---------|
| [github](#provider\_github) | ~> 4 |## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [github_actions_environment_secret.this](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_environment_secret) | resource |
| [github_actions_secret.this](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_secret) | resource |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [environment\_secrets](#input\_environment\_secrets) | A map of environment-scoped secrets | `map(any)` | `{}` | no |
| [repository](#input\_repository) | The full name of the repository in the form org/repo | `string` | n/a | yes |
| [secrets](#input\_secrets) | A map of secret definitions | `map(any)` | `{}` | no |## Outputs
No outputs.