Skip to content

Commit 09778e9

Browse files
author
Steven Nemetz
committed
Add full example - not tested yet
1 parent 1b2ac2f commit 09778e9

File tree

5 files changed

+66
-0
lines changed

5 files changed

+66
-0
lines changed

examples/full/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Example: full
2+
3+
Full example of adding members to organization, creating teams, and add members to teams

examples/full/main.tf

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
module "org-members" {
2+
source = "devops-workflow/members/github"
3+
version = "0.0.1"
4+
5+
providers = {
6+
github = "github.devops"
7+
}
8+
9+
users = [
10+
{
11+
username = "user1"
12+
},
13+
{
14+
username = "user2"
15+
role = "owner"
16+
},
17+
]
18+
}
19+
20+
module "team" {
21+
source = "devops-workflow/teams/github"
22+
version = "0.0.1"
23+
24+
providers = {
25+
github = "github.devops"
26+
}
27+
28+
teams = [
29+
{
30+
name = "team-test"
31+
description = "Team for Terraform testing"
32+
},
33+
]
34+
}
35+
36+
module "team-members" {
37+
source = "../../"
38+
depends_on = ["module.org-members", "module.team"]
39+
team_id = "${element(module.team.ids, 0)}"
40+
41+
providers = {
42+
github = "github.devops"
43+
}
44+
45+
users = [
46+
{
47+
username = "user1"
48+
},
49+
{
50+
username = "user2"
51+
role = "maintainer"
52+
},
53+
]
54+
}

examples/full/outputs.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

examples/full/providers.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
provider "github" {
2+
alias = "devops"
3+
organization = "devops-workflow"
4+
token = "${var.devops_token}"
5+
}

examples/full/variables.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variable "devops_token" {
2+
description = "Github personal access token with owner rights for organization devops-workflow"
3+
}

0 commit comments

Comments
 (0)