Hi all! Is there a way to use boto3 to save files ...
# ask-community
c
Hi all! Is there a way to use boto3 to save files to S3 without the prefect_aws package? I don't mind storing credentials using a block with
from prefect_aws import AwsCredentials
, but I like to use the standardized boto3 when uploading files. Here is the function:
def save_to_s3(directory, file_name, local_file_path):
s3 = boto3.resource('s3')
key = f"{directory}/{file_name}"
s3.meta.client.upload_file(local_file_path, 'test-updates', key)