main.tf
module "organization" {
source = "git@github.com: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
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.
$ terraform init
$ terraform plan -var-file <YOUR_VARS_FILE_NAME>.tfvars -out=tfplan
$ terraform apply tfplan
See example for more information.
The Go library called Terratest is used for testing.
$ cd test/
$ go test -timeout 1m