Skip to content

Commit

Permalink
Merge pull request #2045 from exitcode0/docs_examples
Browse files Browse the repository at this point in the history
Add additional examples to documentation
  • Loading branch information
duytiennguyen-okta authored Jul 31, 2024
2 parents 62a4881 + 764ecd8 commit 4914684
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
37 changes: 36 additions & 1 deletion docs/data-sources/org_metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,42 @@ description: |-

Retrieves the well-known org metadata, which includes the id, configured custom domains, authentication pipeline, and various other org settings.


## Example Usage
```terraform
data "okta_org_metadata" "_" {}
locals {
org_url = try(
data.okta_org_metadata._.alternate,
data.okta_org_metadata._.organization
)
}
resource "okta_resource_set" "iam_resources" {
label = "iam_resources"
description = "iam_resources"
resources = [
"orn:okta:iam:${data.okta_org_metadata._.id}:contained_resources"
]
}
resource "okta_resource_set" "support_resources" {
label = "support_resources"
description = "support_resources"
resources = [
"orn:okta:support:${data.okta_org_metadata._.id}:cases"
]
}
resource "okta_resource_set" "example" {
label = "All users, groups, and apps"
description = "All users, groups, and apps"
resources = [
"${local.org_url}/api/v1/users",
"${local.org_url}/api/v1/apps",
"${local.org_url}/api/v1/groups"
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
19 changes: 19 additions & 0 deletions docs/resources/resource_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ resource "okta_resource_set" "test" {
}
```

```terraform
data "okta_org_metadata" "_" {}
locals {
org_url = try(
data.okta_org_metadata._.alternate,
data.okta_org_metadata._.organization
)
}
resource "okta_resource_set" "example" {
label = "UsersAppsAndGroups"
description = "All the users, app and groups"
resources = [
"${local.org_url}/api/v1/users",
"${local.org_url}/api/v1/apps",
"${local.org_url}/api/v1/groups"
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema

Expand Down

0 comments on commit 4914684

Please sign in to comment.