https://prefect.io logo
Title
e

Egbert Ypma

10/25/2019, 3:03 PM
Hi folks, I'm pretty new to prefect and exploring its possibilities at the moment. I am trying to upload a file to AWS but I am struggling with all the security details. Where can I find an example that uses the S3Upload task as a step in a workflow?
c

Chris White

10/25/2019, 3:16 PM
Hi Egbert! So for that task you currently need two things: - an
ACCESS_KEY
and a
SECRET_ACCESS_KEY
which you can get from your AWS console - once you have those, put them in a dictionary like:
credentials = dict(ACCESS_KEY=my_key, SECRET_ACCESS_KEY=my_secret_key)
- this credentials dictionary now needs to be placed in `prefect.context.secrets`; you can do that directly:
prefect.context.secrets["AWS_CREDENTIALS"] = credentials
- or indirectly by JSON-serializing the dictionary and storing it under the environment variable
PREFECT__CONTEXT__SECRETS__AWS_CREDENTIALS=jsonified-dictionary
e

Egbert Ypma

10/25/2019, 4:09 PM
Thx Chris I'll have a go at it.