diff --git a/docs/data-sources/teams.md b/docs/data-sources/teams.md index ba4d71f..b4ab0c3 100644 --- a/docs/data-sources/teams.md +++ b/docs/data-sources/teams.md @@ -10,7 +10,23 @@ description: |- Retrieves all teams - +## Example Usage + +```terraform +data "ee-platform_teams" "all_teams" {} + +output "teams" { + value = data.ee-platform_teams.all_teams.teams +} + +# example looping over teams +# key === team id +resource "local_file" "foo" { + for_each = data.ee-platform_teams.all_teams.teams + filename = "/tmp/test/${each.key}" + content = "name = ${each.value.name}, department = ${each.value.department}" +} +``` ## Schema diff --git a/examples/provider-install-verification/main.tf b/examples/provider-install-verification/main.tf index 73ad878..a6d9b2c 100644 --- a/examples/provider-install-verification/main.tf +++ b/examples/provider-install-verification/main.tf @@ -8,14 +8,16 @@ terraform { provider "ee-platform" {} -data "ee-platform_teams" "teams" {} +data "ee-platform_teams" "all_teams" {} -output "all_teams" { - value = data.ee-platform_teams.teams.teams +output "teams" { + value = data.ee-platform_teams.all_teams.teams } +# example looping over teams +# key === team id resource "local_file" "foo" { - for_each = data.ee-platform_teams.teams.teams + for_each = data.ee-platform_teams.all_teams.teams filename = "/tmp/test/${each.key}" - content = each.value.name + content = "name = ${each.value.name}, department = ${each.value.department}" } \ No newline at end of file