Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: amplitude job to secretsmanager #1766

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading