Skip to content

Commit b089c13

Browse files
Merge pull request #91 from mineiros-io/soerenmartius/fix-example
Use name instead of slug to make the example working again
2 parents 32c1e63 + b7d71b8 commit b089c13

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

examples/public-repository/main.tf

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module "repository" {
1010
version = "~> 0.11.0"
1111

1212
module_depends_on = [
13-
github_team.team
13+
module.team
1414
]
1515

1616
name = "my-public-repository"
@@ -30,7 +30,7 @@ module "repository" {
3030
topics = ["terraform", "unit-test"]
3131

3232
admin_team_ids = [
33-
github_team.team.id
33+
module.team.team.id
3434
]
3535

3636
webhooks = [
@@ -59,13 +59,13 @@ module "repository" {
5959

6060
required_pull_request_reviews = {
6161
dismiss_stale_reviews = true
62-
dismissal_teams = [github_team.team.slug]
62+
dismissal_teams = [module.team.name]
6363
require_code_owner_reviews = true
6464
required_approving_review_count = 1
6565
}
6666

6767
restrictions = {
68-
teams = [github_team.team.slug]
68+
teams = [module.team.name]
6969
}
7070
}
7171
]
@@ -74,23 +74,22 @@ module "repository" {
7474
# ---------------------------------------------------------------------------------------------------------------------
7575
# TEAM
7676
# ---------------------------------------------------------------------------------------------------------------------
77-
resource "github_team" "team" {
78-
name = "My Team"
79-
description = "The best Team out there."
80-
privacy = "secret"
81-
}
8277

83-
# ---------------------------------------------------------------------------------------------------------------------
84-
# TEAM MEMBERSHIP
85-
# We are adding a member to this team: "terraform-test-user-2".
86-
# This existing users and already member of the GitHub Organization "terraform-test" that
87-
# is an Organization managed by Mineiros.io to run integration tests with Terratest.
88-
# ---------------------------------------------------------------------------------------------------------------------
78+
module "team" {
79+
source = "mineiros-io/team/github"
80+
version = "~> 0.8.0"
8981

90-
resource "github_team_membership" "team_membership" {
91-
team_id = github_team.team.id
92-
username = "terraform-test-user-2"
93-
role = "member"
82+
name = "DevOps"
83+
description = "The DevOps Team"
84+
privacy = "secret"
85+
86+
# TEAM MEMBERSHIP
87+
# We are adding a member to this team: "terraform-test-user-2".
88+
# This existing users and already member of the GitHub Organization "terraform-test" that
89+
# is an Organization managed by Mineiros.io to run integration tests with Terratest.
90+
members = [
91+
"terraform-test-user-2",
92+
]
9493
}
9594

9695
# ------------------------------------------------------------------------------

0 commit comments

Comments
 (0)