Skip to content

Commit

Permalink
v2.5.1: change computing of user_password
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed May 26, 2021
1 parent acd1fca commit f56c60e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@

* v2.5.0 -- 20210512
- add `attached_policies` to enable adding policies for an IAM account (generally, just services)

* v2.5.1 -- 20210526
- change computing of output of user_password
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ locals {
email_address = var.email_address != "" ? lower(var.email_address) : module.user_email.search_result["attribute_value"][0]
pgp_key_exists = var.pgp_key != "" ? 1 : 0
generate_password = var.generate_password ? local.pgp_key_exists : 0
user_password = local.generate_password ? element(concat(aws_iam_user_login_profile.user[*].encrypted_password, tolist([])), 0) : ""
ap1 = var.service_account ? var.attached_policies : []
ap2 = [for arn in local.ap1 : {
"policy" = arn
Expand Down
3 changes: 2 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ output "user_arn" {

output "user_password" {
description = "User Password"
value = var.generate_password ? element(aws_iam_user_login_profile.user[*].encrypted_password, 0) : ""
# value = var.generate_password ? element(aws_iam_user_login_profile.user[*].encrypted_password, 0) : ""
value = local.user_password
}
2 changes: 1 addition & 1 deletion version.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
_module_version = "2.5.0"
_module_version = "2.5.1"
}

0 comments on commit f56c60e

Please sign in to comment.