Skip to content

Commit 66acc10

Browse files
chore: use secrets manager for prefect flows deployment.
1 parent 8df54b5 commit 66acc10

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

dataeng/resources/prefect-flows-deployment.sh

+2-14
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,8 @@ aws ecr describe-repositories --repository-names $FLOW_NAME --region us-east-1 |
2929
# Do not print commands in this function since they may contain secrets.
3030
set +x
3131

32-
# Retrieve a vault token corresponding to the jenkins AppRole. The token is then stored in the VAULT_TOKEN variable
33-
# which is implicitly used by subsequent vault commands within this script.
34-
# Instructions followed: https://learn.hashicorp.com/tutorials/vault/approle#step-4-login-with-roleid-secretid
35-
export VAULT_TOKEN=$(vault write -field=token auth/approle/login \
36-
role_id=${ANALYTICS_VAULT_ROLE_ID} \
37-
secret_id=${ANALYTICS_VAULT_SECRET_ID}
38-
)
39-
40-
PREFECT_CLOUD_AGENT_TOKEN=$(
41-
vault kv get \
42-
-version=${PREFECT_VAULT_KV_VERSION} \
43-
-field=PREFECT_CLOUD_AGENT_TOKEN \
44-
${PREFECT_VAULT_KV_PATH} \
45-
)
32+
# Fetch the secrets from AWS
33+
PREFECT_CLOUD_AGENT_TOKEN=$(aws secretsmanager get-secret-value --secret-id analytics-secure/prefect-cd --region us-east-1 --query SecretString --output text | jq -r ".PREFECT_CLOUD_AGENT_TOKEN")
4634

4735
# Get Authenticated with Prefect Cloud
4836
prefect auth login --key $PREFECT_CLOUD_AGENT_TOKEN

0 commit comments

Comments
 (0)