From 45df680581b8758a6f47d3938cb9f1146f8bcc5d Mon Sep 17 00:00:00 2001 From: badra001 Date: Wed, 13 Dec 2023 16:14:10 -0500 Subject: [PATCH] * 1.0.4 -- 2023-12-13 - add user_mapping to replace the mail address --- CHANGELOG.md | 3 +++ common/version.tf | 2 +- group-assignment/sample.yml | 1 + group-assignment/users.tf | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bc74c1..724fa1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,3 +12,6 @@ * 1.0.3 -- 2023-12-12 - update to make ou list or ou ids work + +* 1.0.4 -- 2023-12-13 + - add user_mapping to replace the mail address diff --git a/common/version.tf b/common/version.tf index 1dfb710..4840281 100644 --- a/common/version.tf +++ b/common/version.tf @@ -1,3 +1,3 @@ locals { - _module_version = "1.0.3" + _module_version = "1.0.4" } diff --git a/group-assignment/sample.yml b/group-assignment/sample.yml index 0eaad9a..e8019df 100644 --- a/group-assignment/sample.yml +++ b/group-assignment/sample.yml @@ -5,4 +5,5 @@ all: true account_names: [] account_ids: [] org_ous: [] +user_mapping: {} users: [] diff --git a/group-assignment/users.tf b/group-assignment/users.tf index 0d52177..2025c22 100644 --- a/group-assignment/users.tf +++ b/group-assignment/users.tf @@ -2,6 +2,7 @@ locals { user_base_dn = "ou=People,o=U.S. Census Bureau,c=US" ldap_user_attributes = { for k, v in data.ldap_object.users : k => { for kk, vv in v.attributes_json : kk => jsondecode(vv)[0] } } users = length(local.settings) > 0 ? try(local.settings.users, []) : var.users + user_mapping = length(local.settings) > 0 ? try(local.settings.user_mapping, {}) : {} } data "ldap_object" "users" { @@ -20,7 +21,7 @@ data "aws_identitystore_user" "users" { alternate_identifier { unique_attribute { attribute_path = "UserName" - attribute_value = each.value + attribute_value = lookup(local.user_mapping, each.key, each.value) } } }