Jon Page
06/11/2020, 4:55 PMboto3.Session().get_credentials().access_key
vs.
PrefectSecret("AWS_CREDENTIALS")["ACCESS_KEY"]
Pretty sure I followed these instructions: https://docs.prefect.io/core/concepts/secrets.html#default-secrets.
Both values are keys, but the one in the boto3 session is not one that I recognize.Laura Lorenz (she/her)
06/11/2020, 5:09 PMAWS_CREDENTIALS
secret for you if it didn’t get the creds some other way (https://github.com/PrefectHQ/prefect/blob/master/src/prefect/utilities/aws.py#L36)
If you want to instantiate a boto client in custom task code that takes advantage of prefect secrets, you can either run the PrefectSecret task first in the flow graph and pass those credentials in to your custom task as arguments, or you can have any boto3 client you instantiate directly do something similar to that utility function I linked above (or use it directly!). The latter is how the prefect task library gets away with it for example: https://github.com/PrefectHQ/prefect/blob/master/src/prefect/tasks/aws/lambda_function.py#L125