From 31fa59de1640aec34be3493eeae94c999015a185 Mon Sep 17 00:00:00 2001 From: katebygrace Date: Wed, 8 May 2024 16:08:28 -0400 Subject: [PATCH] chore: collect metrics jobs to secretsmanager JIRA:CLOUDSEC-12 --- dataeng/resources/snowflake-collect-metrics.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dataeng/resources/snowflake-collect-metrics.sh b/dataeng/resources/snowflake-collect-metrics.sh index 0f18f753a..74967defb 100644 --- a/dataeng/resources/snowflake-collect-metrics.sh +++ b/dataeng/resources/snowflake-collect-metrics.sh @@ -10,10 +10,19 @@ source "${PYTHON_VENV}/bin/activate" cd $WORKSPACE/analytics-tools/snowflake make requirements +python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_snowflake_task_automation_user.p8 -v rsa_key_snowflake_task_automation_user +python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_passphrase_snowflake_task_automation_user -v rsa_key_passphrase_snowflake_task_automation_user + + + python collect-metrics.py \ --metric_name $METRIC_NAME \ - --key_path $WORKSPACE/analytics-secure/snowflake/rsa_key_snowflake_task_automation_user.p8 \ - --passphrase_path $WORKSPACE/analytics-secure/snowflake/rsa_key_passphrase_snowflake_task_automation_user \ --automation_user $SNOWFLAKE_USER \ --account $SNOWFLAKE_ACCOUNT \ - --warehouse $SNOWFLAKE_WAREHOUSE + --warehouse $SNOWFLAKE_WAREHOUSE \ + --key_file "$(cat "rsa_key_snowflake_task_automation_user")" \ + --passphrase_file "$(cat "rsa_key_passphrase_snowflake_task_automation_user")" + + +rm rsa_key_snowflake_task_automation_user +rm rsa_key_passphrase_snowflake_task_automation_user