-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
create_okta_user_assign_to_group
mod (#25)
- Loading branch information
1 parent
bb62991
commit d9a84ef
Showing
5 changed files
with
137 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Create a user in Okta and assign to a group | ||
|
||
Create a user in Okta and assign to a group. | ||
|
||
## Usage | ||
|
||
- Add following required credentials to `flowpipe.fpvars` | ||
- Okta domain and API token | ||
|
||
- Start your Flowpipe server `flowpipe server` | ||
|
||
- Create a user in Okta and add to a group. This step is an independent pipeline to create user and assign to a group e.g. | ||
|
||
``` | ||
flowpipe pipeline run create_okta_user_assign_to_group --arg first_name='Foo' --arg last_name='Bar' --arg email='[email protected]' --arg login='foo.bar' --arg password='password' --arg group_id='00g1x2x3x4x5x6x7x8x9' | ||
``` |
90 changes: 90 additions & 0 deletions
90
create_okta_user_assign_to_group/create_okta_user_assign_to_group.fp
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,90 @@ | ||
pipeline "create_okta_user_assign_to_group" { | ||
title = "Create User Assign Group" | ||
description = "Create a user and assign it to a group." | ||
|
||
param "api_token" { | ||
description = "The personal api_token to authenticate to the Okta APIs." | ||
type = string | ||
default = var.api_token | ||
} | ||
|
||
param "domain" { | ||
description = "The domain of your Okta account." | ||
type = string | ||
default = var.domain | ||
} | ||
|
||
param "first_name" { | ||
description = "Given name of the user." | ||
type = string | ||
} | ||
|
||
param "last_name" { | ||
description = "The family name of the user." | ||
type = string | ||
} | ||
|
||
param "email" { | ||
description = "The primary email address of the user." | ||
type = string | ||
} | ||
|
||
param "login" { | ||
description = "The unique identifier for the user." | ||
type = string | ||
} | ||
|
||
param "password" { | ||
description = "Specifies the password for a user." | ||
type = string | ||
} | ||
|
||
param "group_id" { | ||
description = "The ID of the group." | ||
type = string | ||
} | ||
|
||
step "pipeline" "create_user" { | ||
pipeline = okta.pipeline.create_user | ||
args = { | ||
api_token = param.api_token | ||
domain = param.domain | ||
first_name = param.first_name | ||
last_name = param.last_name | ||
email = param.email | ||
login = param.login | ||
password = param.password | ||
} | ||
} | ||
|
||
step "pipeline" "assign_user" { | ||
pipeline = okta.pipeline.assign_user | ||
args = { | ||
api_token = param.api_token | ||
domain = param.domain | ||
group_id = param.group_id | ||
user_id = step.pipeline.create_user.output.user.id | ||
} | ||
} | ||
|
||
step "pipeline" "list_member_users" { | ||
depends_on = [step.pipeline.assign_user] | ||
|
||
pipeline = okta.pipeline.list_member_users | ||
args = { | ||
api_token = param.api_token | ||
domain = param.domain | ||
group_id = param.group_id | ||
} | ||
} | ||
|
||
output "user" { | ||
description = "User details." | ||
value = step.pipeline.create_user.output | ||
} | ||
|
||
output "group_members" { | ||
description = "List of users that are members of the group." | ||
value = step.pipeline.list_member_users.output | ||
} | ||
} |
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,8 @@ | ||
domain = "<Domain>" | ||
api_token = "<API Token>" | ||
group_id = "<Group ID>" | ||
first_name = "<First Name>" | ||
last_name = "<Last Name>" | ||
email = "<Email>" | ||
login = "<Username>" | ||
password = "<Password>" |
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,14 @@ | ||
mod "create_okta_user_assign_to_group" { | ||
title = "Create User and Assign Group" | ||
description = "Create a user in Okta and assign to a group." | ||
|
||
require { | ||
mod "github.com/turbot/flowpipe-mod-okta" { | ||
version = "v0.0.2-rc.2" | ||
args = { | ||
api_token = var.api_token | ||
domain = var.domain | ||
} | ||
} | ||
} | ||
} |
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,9 @@ | ||
variable "domain" { | ||
type = string | ||
description = "The URL of the Okta domain. Exmaple: 'https://dev-50078045.okta.com'" | ||
} | ||
|
||
variable "api_token" { | ||
type = string | ||
description = "The Okta personal access api_token to authenticate to the Okta APIs, e.g., '00B630jSCGU4jV4o5Yh4KQMAdqizwE2OgVcS7N9UHb'. Please see https://developer.okta.com/docs/guides/create-an-api-api_token/main/#oauth-2-0-instead-of-api-api_tokens for more information." | ||
} |