Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed iam-user module when encrypted_ses_smtp_password_v4 is null #275

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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