Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ega4432/terraform-github-org-setup
This is a Terraform module to invite members to your organization and create each repositories.
https://github.com/ega4432/terraform-github-org-setup
github-provider terraform terraform-module
Last synced: about 1 month ago
JSON representation
This is a Terraform module to invite members to your organization and create each repositories.
- Host: GitHub
- URL: https://github.com/ega4432/terraform-github-org-setup
- Owner: ega4432
- Created: 2023-09-07T04:08:04.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-28T05:16:05.000Z (7 months ago)
- Last Synced: 2024-04-28T07:39:41.683Z (7 months ago)
- Topics: github-provider, terraform, terraform-module
- Language: HCL
- Homepage:
- Size: 228 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# terraform-github-org-setup
[![CI](https://github.com/ega4432/terraform-github-org-setup/actions/workflows/ci.yaml/badge.svg)](https://github.com/ega4432/terraform-github-org-setup/actions/workflows/ci.yaml)
## Usage
`main.tf`
```tf
module "organization" {
source = "[email protected]:ega4432/terraform-github-org-setup.git"org_settings = {
billing_email = var.billing_email
default_repository_permission = var.default_repository_permission
}admins = var.admins
members = var.members
}
````*.tfvars`
```tf
github_pat = "YOUR_GITHUB_PERSONAL_ACCESS_TOKEN"billing_email = "YOUR_ORGANIZATION_USER_EMAIL"
default_repository_permission = "none" # Repository permissions for members (default to "read only")
org_name = "YOUR_ORGANIZATION_NAME"admins = [] # YOUR_ORGANIZATION_ADMIN_USERS
members = [ # YOUR_ORGANIZATION_MEMBERS
{
user = "xxx"
fullname = "xxx xxx"
}
{
user = "yyy"
fullname = "yyy yyy"
}
]
```Once you have prepared the necessary files as described above, execute the following command.
```sh
$ terraform init$ terraform plan -var-file .tfvars -out=tfplan
$ terraform apply tfplan
```See [example](https://github.com/ega4432/terraform-github-org-setup/tree/main/examples/organization) for more information.
## Test
The Go library called [Terratest](https://github.com/gruntwork-io/terratest) is used for testing.
```sh
$ cd test/$ go test -timeout 1m
```