Joshua Caskie
06/03/2024, 5:39 PMMarvin
06/03/2024, 5:39 PMAwsCredentials
block in the prefect-aws
collection does support reading credentials from your local AWS credentials file. It does not require you to explicitly specify the access and secret keys, provided you configure it correctly.
Here's a brief code example:
python
from prefect_aws import AwsCredentials
aws_credentials = AwsCredentials.load("BLOCK_NAME")
Additional resources:
- API documentation: Prefect AWS API Documentation
- Guideline for using secrets: Moving Data with Prefect
Furthermore, a related GitHub issue discusses how the AWS client parameters should be correctly assigned to an S3 bucket block, providing insight into integrating the credentials without directly specifying them in your code.
If there's any finer detail you'd like me to check or another aspect you'd like to dive into, feel free to ask!Kevin Grismore
06/03/2024, 5:42 PMJoshua Caskie
06/03/2024, 7:10 PMAwsCredentials().save("aws-credentials", overwrite=True)
and I'm running
prefect block register --file blocks.py
I have my credentials in my shared .aws credentials file (and this works fine interacting with general boto3 and aioboto3 python code).Joshua Caskie
06/03/2024, 7:11 PMKevin Grismore
06/04/2024, 2:19 PMKevin Grismore
06/04/2024, 2:19 PM