Skip to content

Commit 2c479b2

Browse files
authored
Merge pull request #1766 from edx/katebygrace/amplitude-secrestmanager
chore: amplitude job to secretsmanager
2 parents bccebdb + 13e7415 commit 2c479b2

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

dataeng/jobs/analytics/AmplitudeUserPropertiesBackfill.groovy

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ class AmplitudeUserPropertiesBackfill {
2424
stringParam('AMPLITUDE_OPERATION_NAME', '', 'Amplitude user property operation name. e.g: set or setOnce.')
2525
}
2626
environmentVariables {
27-
env('KEY_PATH', allVars.get('KEY_PATH'))
28-
env('PASSPHRASE_PATH', allVars.get('PASSPHRASE_PATH'))
2927
env('USER', allVars.get('USER'))
3028
env('ACCOUNT', allVars.get('ACCOUNT'))
3129
env('AMPLITUDE_VAULT_KV_PATH', allVars.get('AMPLITUDE_VAULT_KV_PATH'))

dataeng/resources/amplitude-properties-backfill.sh

+13-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,22 @@ API_KEY=$(
2626
-version=${AMPLITUDE_VAULT_KV_VERSION} \
2727
-field=API_KEY \
2828
${AMPLITUDE_VAULT_KV_PATH} \
29-
)
29+
30+
31+
python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_snowpipe_user.p8 -v rsa_key_snowflake_task_automation_user
32+
python3 secrets-manager.py -w -n analytics-secure/snowflake/rsa_key_passphrase_snowpipe_user -v rsa_key_passphrase_snowflake_task_automation_user
33+
3034
3135
python amplitude_user_properties_update.py \
32-
--key_path $KEY_PATH \
33-
--passphrase_path $PASSPHRASE_PATH \
34-
--automation_user $USER \
35-
--account $ACCOUNT \
36+
--automation_user 'SNOWFLAKE_TASK_AUTOMATION_USER' \
37+
--account 'edx.us-east-1' \
3638
--amplitude_data_source_table $AMPLITUDE_DATA_SOURCE_TABLE \
3739
--columns_to_update $COLUMNS_TO_UPDATE \
3840
--response_table $RESPONSE_TABLE \
3941
--amplitude_operation_name $AMPLITUDE_OPERATION_NAME \
40-
--amplitude_api_key $API_KEY
42+
--amplitude_api_key $API_KEY \
43+
--key_file "$(cat "rsa_key_snowflake_task_automation_user")" \
44+
--passphrase_file "$(cat "rsa_key_passphrase_snowflake_task_automation_user")"
45+
46+
rm rsa_key_snowflake_task_automation_user
47+
rm rsa_key_passphrase_snowflake_task_automation_user

0 commit comments

Comments
 (0)