From 5c2c58a4dc47b0a0c57365f98ecfb1f40a17c967 Mon Sep 17 00:00:00 2001 From: Mars Hall Date: Wed, 22 Feb 2023 11:35:18 -0800 Subject: [PATCH] Omit sensitive_config_vars values from TF_LOG=debug output (#362) --- heroku/resource_heroku_app.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/heroku/resource_heroku_app.go b/heroku/resource_heroku_app.go index 37eb31f4..923ebdc7 100644 --- a/heroku/resource_heroku_app.go +++ b/heroku/resource_heroku_app.go @@ -408,12 +408,16 @@ func resourceHerokuAppRead(d *schema.ResourceData, meta interface{}) error { } } - log.Printf("[LOG] Setting config vars: %s", configVars) + log.Printf("[DEBUG] Setting config vars: %s", configVars) if err := d.Set("config_vars", configVars); err != nil { log.Printf("[WARN] Error setting config vars: %s", err) } - log.Printf("[LOG] Setting sensitive config vars: %s", sensitiveConfigVars) + var sensitiveVarNames []string + for sensitiveVarName, _ := range sensitiveConfigVars { + sensitiveVarNames = append(sensitiveVarNames, sensitiveVarName) + } + log.Printf("[DEBUG] Setting sensitive config vars: %s", sensitiveVarNames) if err := d.Set("sensitive_config_vars", sensitiveConfigVars); err != nil { log.Printf("[WARN] Error setting sensitive config vars: %s", err) }