From 84fbcf5708a4ef66b8385c6ec09ad597478e8d45 Mon Sep 17 00:00:00 2001 From: Rob Whitby Date: Wed, 25 Sep 2024 16:37:56 +0100 Subject: [PATCH] more docs tweaks --- docs/data-sources/teams.md | 18 +++++++++++++++++- examples/provider-install-verification/main.tf | 12 +++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) 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