Pedro Machado
05/23/2020, 9:33 PMPREFECT__CONTEXT__SECRETS__AWS_CREDENTIALS
in a .env
file that I am loading with dotenv.load_dotenv()
The env variables are being passed to the Python script OK.
Then inside a task, I create an s3 client that is used in a module I created (seudo code):
@tasks
def mytask:
api_client = MyPrivateClient(s3_client=boto3.client("s3"))
api_client.execute()
Then I get NoCredentialsError
After reading https://docs.prefect.io/core/concepts/secrets.html#default-secrets I thought the credentials would be exposed as environment variables for the client to use. Should I be getting them explicitly from the context or using the default env vars that boto3 will look for?Chris White
05/23/2020, 9:37 PMfrom prefect.utilities.aws import get_boto_client
s3_client = get_boto_client('s3')
The above code should create a client that uses your Prefect secret as you expectPedro Machado
05/23/2020, 10:34 PMChris White
05/23/2020, 10:36 PM