Skip to content

Commit 88aebbf

Browse files
EspenAlbertCopilot
andauthored
doc: Correctly access user roles in org_users_with_roles output (#3683)
* doc: Correctly access user roles in org_users_with_roles output * Update examples/migrate_atlas_user_and_atlas_users/v3/outputs.tf Co-authored-by: Copilot <[email protected]> * Revert "Update examples/migrate_atlas_user_and_atlas_users/v3/outputs.tf" This reverts commit 262f0b2. * doc: Clarify comment on org_users_with_roles output regarding role representation * style: Adjust formatting for consistency in org_users_with_roles output --------- Co-authored-by: Copilot <[email protected]>
1 parent d397eb1 commit 88aebbf

File tree

1 file changed

+5
-4
lines changed
  • examples/migrate_atlas_user_and_atlas_users/v3

1 file changed

+5
-4
lines changed

examples/migrate_atlas_user_and_atlas_users/v3/outputs.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ output "org_users_with_roles" {
6161
description = "Organization users with their roles"
6262
value = [
6363
for user in data.mongodbatlas_organization.org.users : {
64-
username = user.username
65-
user_id = user.id
66-
org_roles = user.roles.org_roles
67-
project_assignments = user.roles.project_role_assignments
64+
username = user.username
65+
user_id = user.id
66+
# Although the API defines roles as an object, in the organization and team data sources roles are represented as a list. This is due to SDK v2 only supporting blocks for nested elements.
67+
org_roles = user.roles[0].org_roles
68+
project_assignments = user.roles[0].project_role_assignments
6869
}
6970
]
7071
}

0 commit comments

Comments
 (0)