Skip to content

Commit

Permalink
Merge pull request #1763 from edx/katebygrace/public-grants-cleaner
Browse files Browse the repository at this point in the history
Katebygrace/public grants cleaner
  • Loading branch information
katebygrace authored May 17, 2024
2 parents 94f9613 + 83b6004 commit f0ac5c0
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions dataeng/resources/snowflake-public-grants-cleaner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ source "${PYTHON_VENV}/bin/activate"
cd $WORKSPACE/analytics-tools/snowflake
make requirements

source secrets-manager.sh analytics-secure/job-configs/SNOWFLAKE_PUBLIC_GRANTS_CLEANER_JOB_EXTRA_VARS KEY_PATH
source secrets-manager.sh analytics-secure/job-configs/SNOWFLAKE_PUBLIC_GRANTS_CLEANER_JOB_EXTRA_VARS PASSPHRASE_PATH
source secrets-manager.sh analytics-secure/job-configs/SNOWFLAKE_PUBLIC_GRANTS_CLEANER_JOB_EXTRA_VARS USER
source secrets-manager.sh analytics-secure/job-configs/SNOWFLAKE_PUBLIC_GRANTS_CLEANER_JOB_EXTRA_VARS ACCOUNT
python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_stitch_loader.p8 -v rsa_key_stitch_loader
python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_passphrase_stitch_loader -v rsa_key_passphrase_stitch_loader

unset KEY_PATH
unset PASSPHRASE_PATH

python snowflake_public_grants_cleaner.py \
--key_path $WORKSPACE/analytics-secure/$KEY_PATH \
--passphrase_path $WORKSPACE/analytics-secure/$PASSPHRASE_PATH \
--user $USER \
--account $ACCOUNT
--user "STITCH_LOADER" \
--account "edx.us-east-1" \
--key_file "$(cat "rsa_key_stitch_loader")" \
--passphrase_file "$(cat "rsa_key_passphrase_stitch_loader")"


rm rsa_key_stitch_loader
rm rsa_key_passphrase_stitch_loader

0 comments on commit f0ac5c0

Please sign in to comment.