Skip to content

Commit

Permalink
skip variables with pattern '.*[password|secret].*'
Browse files Browse the repository at this point in the history
  • Loading branch information
tbugfinder committed Mar 23, 2022
1 parent c100812 commit 85681c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hooks/createi2o.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ if [ -f "${TFHFILE}" ] ; then
rm -f "${TFHFILE}"
fi

TFDOCSHCL=$(terraform-docs tfvars json "${CWD}" | jq -r 'keys[] as $k | "\($k) = var.\($k)"' | indenttfo )
TFDOCSHCL=$(terraform-docs tfvars json "${CWD}" | jq -r 'with_entries(select(.key | contains("password") or contains ("secret") |not)) | keys[] as $k | "\($k) = var.\($k)"' | indenttfo )

cat > "${TFHFILE}" <<EOF
# This file has been created automatically.
# terraform variables are passed to outputs.
# Following variable names are skipped: '.*[password|secret].*'.
output "inputs2outputs" {
description = "all inputs passed to outputs"
Expand Down

0 comments on commit 85681c9

Please sign in to comment.