forked from aws-ia/terraform-aws-permission-sets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.tf
42 lines (35 loc) · 1.26 KB
/
data.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
data "aws_organizations_organization" "org" {}
data "aws_ssoadmin_instances" "sso" {}
data "aws_identitystore_group" "sso" {
for_each = { for group in local.ps_groups : group.Name => group }
identity_store_id = tolist(data.aws_ssoadmin_instances.sso.identity_store_ids)[0]
alternate_identifier {
unique_attribute {
attribute_path = "DisplayName"
attribute_value = each.value.Name
}
}
}
data "aws_identitystore_user" "sso" {
for_each = { for user in local.ps_users : user.Name => user }
identity_store_id = tolist(data.aws_ssoadmin_instances.sso.identity_store_ids)[0]
alternate_identifier {
unique_attribute {
attribute_path = "UserName"
attribute_value = each.value.Name
}
}
}
data "aws_organizations_organizational_unit_descendant_accounts" "org_accounts" {
parent_id = data.aws_organizations_organization.org.roots[0].id
}
data "aws_organizations_organizational_unit_descendant_accounts" "accounts_per_ou" {
for_each = toset(local.ps_ou_list)
parent_id = each.key
}
data "aws_organizations_resource_tags" "account_tags" {
for_each = toset(local.org_accounts)
resource_id = each.key
}