Skip to content

Commit

Permalink
fix: Fixed iam-user module when encrypted_ses_smtp_password_v4 is `…
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolay authored Sep 6, 2022
1 parent 37f97c0 commit 936d0f1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/iam-user/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
locals {
has_encrypted_password = length(compact(aws_iam_user_login_profile.this[*].encrypted_password)) > 0
has_encrypted_secret = length(compact(aws_iam_access_key.this[*].encrypted_secret)) > 0
has_encrypted_password = length(compact(aws_iam_user_login_profile.this[*].encrypted_password)) > 0
has_encrypted_secret = length(compact(aws_iam_access_key.this[*].encrypted_secret)) > 0
has_encrypted_ses_smtp_password_v4 = length(compact(aws_iam_access_key.this[*].encrypted_ses_smtp_password_v4)) > 0
}

output "iam_user_name" {
Expand Down Expand Up @@ -120,15 +121,15 @@ EOF

output "keybase_ses_smtp_password_v4_decrypt_command" {
description = "Decrypt SES SMTP password command"
value = !local.has_encrypted_secret ? null : <<EOF
value = !local.has_encrypted_ses_smtp_password_v4 ? null : <<EOF
echo "${try(aws_iam_access_key.this[0].encrypted_ses_smtp_password_v4, "")}" | base64 --decode | keybase pgp decrypt
EOF

}

output "keybase_ses_smtp_password_v4_pgp_message" {
description = "Encrypted SES SMTP password"
value = !local.has_encrypted_secret ? null : <<EOF
value = !local.has_encrypted_ses_smtp_password_v4 ? null : <<EOF
-----BEGIN PGP MESSAGE-----
Version: Keybase OpenPGP v2.0.76
Comment: https://keybase.io/crypto
Expand Down

0 comments on commit 936d0f1

Please sign in to comment.