This repository has been archived by the owner on Jun 14, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from articulate/okta_users
Compose Groups and okta_users data source
- Loading branch information
Showing
21 changed files
with
590 additions
and
198 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
resource "okta_group" "test" { | ||
resource okta_group test { | ||
name = "something new" | ||
description = "testing, testing" | ||
users = ["${okta_user.test.id}"] | ||
} | ||
|
||
data "okta_group" "test" { | ||
name = "${okta_group.test.name}" | ||
resource okta_user test { | ||
first_name = "TestAcc" | ||
last_name = "Jones" | ||
login = "john_replace_with_uuid@ledzeppelin.com" | ||
email = "john_replace_with_uuid@ledzeppelin.com" | ||
} | ||
|
||
data okta_group test { | ||
include_users = true | ||
name = "${okta_group.test.name}" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
resource "okta_group" "testAcc_replace_with_uuid" { | ||
resource "okta_group" "test" { | ||
name = "testAcc" | ||
description = "testing, testing" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
resource "okta_group" "testAcc_replace_with_uuid" { | ||
resource "okta_group" "test" { | ||
name = "testAccDifferent" | ||
description = "testing, testing" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Notice users are on added to the group and group_membership is left empty. | ||
// It is generally advisable to pick a single method of tying users to groups. | ||
// To remove all membership specify an empty list. This is the only way to catch config drift | ||
// and support multiple ways to outline the same config. | ||
resource "okta_group" "test" { | ||
name = "testAcc" | ||
description = "testing, testing" | ||
|
||
users = [ | ||
"${okta_user.test.id}", | ||
"${okta_user.test1.id}", | ||
"${okta_user.test2.id}", | ||
"${okta_user.test3.id}", | ||
] | ||
} | ||
|
||
resource okta_user test { | ||
first_name = "TestAcc" | ||
last_name = "Jones" | ||
login = "john_replace_with_uuid@ledzeppelin.com" | ||
email = "john_replace_with_uuid@ledzeppelin.com" | ||
} | ||
|
||
resource okta_user test1 { | ||
first_name = "TestAcc" | ||
last_name = "Entwhistle" | ||
login = "john_replace_with_uuid@thewho.com" | ||
email = "john_replace_with_uuid@thewho.com" | ||
} | ||
|
||
resource okta_user test2 { | ||
first_name = "TestAcc" | ||
last_name = "Doe" | ||
login = "john_replace_with_uuid@unknown.com" | ||
email = "john_replace_with_uuid@unknown.com" | ||
} | ||
|
||
resource okta_user test3 { | ||
first_name = "TestAcc" | ||
last_name = "Astley" | ||
login = "rick_astley_replace_with_uuid@rickrollin.com" | ||
email = "rick_astley_replace_with_uuid@rickrollin.com" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# okta_users | ||
|
||
Data source to retrieve multiple users. [See Okta documentation for more details](https://developer.okta.com/docs/api/resources/users). | ||
|
||
* Example of a simple data source [can be found here](./basic.tf) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
data okta_users test { | ||
search { | ||
name = "profile.email" | ||
value = "john_replace_with_uuid" | ||
comparison = "sw" | ||
} | ||
} | ||
|
||
resource okta_user test { | ||
first_name = "TestAcc" | ||
last_name = "Jones" | ||
login = "john_replace_with_uuid@ledzeppelin.com" | ||
email = "john_replace_with_uuid@ledzeppelin.com" | ||
} | ||
|
||
resource okta_user test1 { | ||
first_name = "TestAcc" | ||
last_name = "Entwhistle" | ||
login = "john_replace_with_uuid@thewho.com" | ||
email = "john_replace_with_uuid@thewho.com" | ||
} | ||
|
||
resource okta_user test2 { | ||
first_name = "TestAcc" | ||
last_name = "Doe" | ||
login = "john_replace_with_uuid@unknown.com" | ||
email = "john_replace_with_uuid@unknown.com" | ||
} | ||
|
||
resource okta_user test3 { | ||
first_name = "TestAcc" | ||
last_name = "Astley" | ||
login = "rick_astley_replace_with_uuid@rickrollin.com" | ||
email = "rick_astley_replace_with_uuid@rickrollin.com" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
resource okta_user test { | ||
first_name = "TestAcc" | ||
last_name = "Jones" | ||
login = "john_replace_with_uuid@ledzeppelin.com" | ||
email = "john_replace_with_uuid@ledzeppelin.com" | ||
} | ||
|
||
resource okta_user test1 { | ||
first_name = "TestAcc" | ||
last_name = "Entwhistle" | ||
login = "john_replace_with_uuid@thewho.com" | ||
email = "john_replace_with_uuid@thewho.com" | ||
} | ||
|
||
resource okta_user test2 { | ||
first_name = "TestAcc" | ||
last_name = "Doe" | ||
login = "john_replace_with_uuid@unknown.com" | ||
email = "john_replace_with_uuid@unknown.com" | ||
} | ||
|
||
resource okta_user test3 { | ||
first_name = "TestAcc" | ||
last_name = "Astley" | ||
login = "rick_astley_replace_with_uuid@rickrollin.com" | ||
email = "rick_astley_replace_with_uuid@rickrollin.com" | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.