Skip to content

Commit

Permalink
Merge pull request #1766 from edx/katebygrace/amplitude-secrestmanager
Browse files Browse the repository at this point in the history
chore: amplitude job to secretsmanager
  • Loading branch information
katebygrace committed May 20, 2024
2 parents bccebdb + 13e7415 commit 2c479b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 0 additions & 2 deletions dataeng/jobs/analytics/AmplitudeUserPropertiesBackfill.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class AmplitudeUserPropertiesBackfill {
stringParam('AMPLITUDE_OPERATION_NAME', '', 'Amplitude user property operation name. e.g: set or setOnce.')
}
environmentVariables {
env('KEY_PATH', allVars.get('KEY_PATH'))
env('PASSPHRASE_PATH', allVars.get('PASSPHRASE_PATH'))
env('USER', allVars.get('USER'))
env('ACCOUNT', allVars.get('ACCOUNT'))
env('AMPLITUDE_VAULT_KV_PATH', allVars.get('AMPLITUDE_VAULT_KV_PATH'))
Expand Down
19 changes: 13 additions & 6 deletions dataeng/resources/amplitude-properties-backfill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,22 @@ API_KEY=$(
-version=${AMPLITUDE_VAULT_KV_VERSION} \
-field=API_KEY \
${AMPLITUDE_VAULT_KV_PATH} \
)
python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_snowpipe_user.p8 -v rsa_key_snowflake_task_automation_user
python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_passphrase_snowpipe_user -v rsa_key_passphrase_snowflake_task_automation_user
python amplitude_user_properties_update.py \
--key_path $KEY_PATH \
--passphrase_path $PASSPHRASE_PATH \
--automation_user $USER \
--account $ACCOUNT \
--automation_user 'SNOWFLAKE_TASK_AUTOMATION_USER' \
--account 'edx.us-east-1' \
--amplitude_data_source_table $AMPLITUDE_DATA_SOURCE_TABLE \
--columns_to_update $COLUMNS_TO_UPDATE \
--response_table $RESPONSE_TABLE \
--amplitude_operation_name $AMPLITUDE_OPERATION_NAME \
--amplitude_api_key $API_KEY
--amplitude_api_key $API_KEY \
--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

0 comments on commit 2c479b2

Please sign in to comment.