Skip to content

Commit 936d0f1

Browse files
authored
fix: Fixed iam-user module when encrypted_ses_smtp_password_v4 is null (#275)
1 parent 37f97c0 commit 936d0f1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/iam-user/outputs.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
locals {
2-
has_encrypted_password = length(compact(aws_iam_user_login_profile.this[*].encrypted_password)) > 0
3-
has_encrypted_secret = length(compact(aws_iam_access_key.this[*].encrypted_secret)) > 0
2+
has_encrypted_password = length(compact(aws_iam_user_login_profile.this[*].encrypted_password)) > 0
3+
has_encrypted_secret = length(compact(aws_iam_access_key.this[*].encrypted_secret)) > 0
4+
has_encrypted_ses_smtp_password_v4 = length(compact(aws_iam_access_key.this[*].encrypted_ses_smtp_password_v4)) > 0
45
}
56

67
output "iam_user_name" {
@@ -120,15 +121,15 @@ EOF
120121

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

127128
}
128129

129130
output "keybase_ses_smtp_password_v4_pgp_message" {
130131
description = "Encrypted SES SMTP password"
131-
value = !local.has_encrypted_secret ? null : <<EOF
132+
value = !local.has_encrypted_ses_smtp_password_v4 ? null : <<EOF
132133
-----BEGIN PGP MESSAGE-----
133134
Version: Keybase OpenPGP v2.0.76
134135
Comment: https://keybase.io/crypto

0 commit comments

Comments
 (0)