diff --git a/CHANGELOG.md b/CHANGELOG.md index dd9569a..3987388 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -184,3 +184,6 @@ - iam-saml - add tags +* 2.0.4 -- 2022-06-01 + - ldap-ou-create + - add attributes diff --git a/common/version.tf b/common/version.tf index 4ab7a1f..f033f34 100644 --- a/common/version.tf +++ b/common/version.tf @@ -1,3 +1,3 @@ locals { - _module_version = "2.0.3" + _module_version = "2.0.4" } diff --git a/ldap-ou-create/main.tf b/ldap-ou-create/main.tf index 3acd237..24f2884 100644 --- a/ldap-ou-create/main.tf +++ b/ldap-ou-create/main.tf @@ -30,6 +30,7 @@ locals { account_id = var.account_id != "" ? var.account_id : data.aws_caller_identity.current.account_id region = data.aws_region.current.name account_environment = data.aws_arn.current.partition == "aws-us-gov" ? "gov" : "ew" + account_alias = var.account_alias != "" && var.account_alias != null ? var.account_alias : "none" ldif_file = format("%v/setup/ou.%v.ldif", path.root, local.account_id) ldap_exists = fileexists(local.ldif_file) @@ -49,8 +50,11 @@ locals { data "template_file" "ou" { template = file("${path.module}/templates/ou-ldif.tpl") vars = { - account_id = local.account_id - aws_environment = local.account_environment + account_id = local.account_id + aws_environment = local.account_environment + account_alias = local.account_alias + tf_module_name = "aws-vpc-setup/ldap-ou-create" + tf_module_version = local._module_version } } @@ -81,6 +85,9 @@ resource "ldap_object" "ou" { attributes = [ { description = format("account=%s type=%s", local.account_id, local.account_environment) }, { ou = local.account_id }, + { bocApplicationData = format("gov.census.csvd:account_alias=%v", local.account_alias) }, + { bocApplicationData = format("gov.census.csvd:tf_module_name=%v", "aws-inf-setup/ldap-ou-create") }, + { bocApplicationData = format("gov.census.csvd:tf_module_version=%v", local._module_version) }, ] lifecycle { diff --git a/ldap-ou-create/templates/ou-ldif.tpl b/ldap-ou-create/templates/ou-ldif.tpl index 5a8e45f..2775ebf 100644 --- a/ldap-ou-create/templates/ou-ldif.tpl +++ b/ldap-ou-create/templates/ou-ldif.tpl @@ -3,7 +3,10 @@ # ${account_id}, AWS, Cloud, Application, U.S. Census Bureau, US dn: ou=${account_id},ou=AWS,ou=Cloud,ou=Application,o=U.S. Census Bureau,c=US ou: ${account_id} -description: account=${account_id} type=${aws_environment} +description: account=${account_id} type=${aws_environment} alias=${account_alias} +bocApplicationData: gov.census.csvd:account_alias=${account_alias} +bocApplicationData: gov.census.csvd:tf_module_name=${tf_module_name} +bocApplicationData: gov.census.csvd:tf_module_version=${tf_module_version} objectClass: organizationalUnit objectClass: ndsLoginProperties objectClass: ndsContainerLoginProperties