Last active
February 2, 2019 21:11
-
-
Save dgmorales/31071f7c6482d318e4e2b8fdd73500b9 to your computer and use it in GitHub Desktop.
Terraform GitHub example showing some basic resource usage
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 = "my-organization" | |
} | |
# Add a user to the organization | |
resource "github_membership" "dgmorales" { | |
username = "dgmorales" | |
role = "member" # or "admin" for an org owner | |
} | |
resource "github_team" "my-team" { | |
name = "my-team" | |
description = "My cool team" | |
} | |
resource "github_team_membership" "my_team_membership" { | |
team_id = "${github_team.my-team.id}" | |
username = "dgmorales" | |
role = "member" | |
} | |
resource "github_repository" "some-repo" { | |
name = "some-repo" | |
} | |
resource "github_team_repository" "some_team_repo" { | |
team_id = "${github_team.my-team.id}" | |
repository = "${github_repository.some-repo.name}" | |
permission = "pull" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment