gotcha, so it seems there's a couple ways to go about this
if you're comfortable storing secrets in prefect, you can just create secret blocks for each secret and then just
.load
/ reference them as needed
for reference, you can refer to a secret in a
prefect.yaml
like this
pull:
- prefect.deployments.steps.git_clone:
repository: <https://bitbucket.org/org/repo.git>
access_token: "{{ prefect.blocks.secret.bitbucket-token }}"
or load one in a flow like this
@flow
def foo():
assert Secret.load("my-secret-name").get() == "very-secret-value"
i'd note that in general we recommend passing the name of secret blocks to flows instead of their values
---
otherwise, the interesting thing about our steps like
prefect.deployments.steps.git_clone
is that
they're just fully qualified function names
so if you can write a
python function that fetches from your desired secret location, you could save them as env vars on the runtime machine and load them inside the flow