This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider github { | |
organization = var.organization | |
} | |
# Make the organization configurable through variables | |
variable "organization" { | |
description = "The name of the organization to deploy the resources in." | |
type = string | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
# A map of admin machine users. These users are used for tasks such like CI & CD, releasing, etc. | |
admin_machine_users = { | |
} | |
# A map of GitHub users that should have admin permissions | |
admin_users = { | |
"[email protected]" = "alice" | |
"[email protected]" = "bob" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "github" { | |
version = "~> 2.1" | |
organization = "the-name-of-your-organization" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "team_reviewers" { | |
source = "mineiros-io/team/github" | |
version = "0.1.2" | |
name = "Reviewers" | |
description = "A team of users that are mandatory for reviewing Pull Requests." | |
privacy = "secret" | |
members = [ | |
local.member_users["[email protected]"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
# default settings for private repositories | |
private_defaults = { | |
private = true | |
has_issues = true | |
allow_merge_commit = true | |
topics = [ | |
"iac", | |
"terraform", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "public_repository" { | |
source = "mineiros-io/repository/github" | |
version = "~> 0.1.0" | |
name = "public-repository" | |
homepage_url = "https://medium.com/mineiros" | |
description = "A test repository create for demonstration purpose for the How to manage your GitHub Organization with Terraform article." | |
defaults = local.public_defaults | |
branch_protections = local.default_branch_protections |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module "repository" { | |
source = "mineiros-io/repository/github" | |
version = "0.1.0" | |
name = "i-love-teraform" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------------------------------------------------- | |
# Create the S3 Bucket and DynamoDB Table | |
# --------------------------------------------------------------------------------------------------------------------- | |
module "terraform_state_s3_bucket" { | |
source = "mineiros-io/s3-bucket/aws" | |
version = "~> 0.1.2" | |
bucket = "github-terraform-example-terraform-state" | |
versioning = { |