Scott
03/22/2024, 8:44 PM@flow
def upload_to_s3(dataset_file: Path):
aws_credentials = AwsCredentials.load("my-block")
s3_bucket = S3Bucket(
bucket_name="my-bucket",
aws_credentials=aws_credentials
)
s3_bucket_path = s3_bucket.upload_from_path(dataset_file)
print(f"Uploaded {dataset_file} to {s3_bucket_path}")
return True
When I run this I get a credentials not found error:
botocore.exceptions.NoCredentialsError: Unable to locate credentials
I can see the block in the Prefect Cloud UI and as far as I can tell all the data in it looks good and all the names in the workflow and the block match.
I ran pip install -U prefect
and pip install -U prefect_aws
just to make sure I had the latest versions of the libraries.
What else could I be doing wrong?Kevin Grismore
03/22/2024, 8:45 PMs3_bucket = S3Bucket(
bucket_name="my-bucket",
credentials=aws_credentials <--- change this
)
Kevin Grismore
03/22/2024, 8:46 PMKevin Grismore
03/22/2024, 8:47 PMaws_credentials
to just credentials
Scott
03/22/2024, 8:48 PM