Created
November 28, 2022 11:43
-
-
Save anna-geller/4bc5f2b64dad3195cd4374db37418f32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from prefect import flow | |
from prefect_aws import AwsCredentials | |
from prefect_aws.s3 import S3Bucket | |
@flow | |
async def aws_s3_bucket(): | |
aws_creds = await AwsCredentials.load("default") | |
s3_bucket = S3Bucket( | |
bucket_name="prefect-orion", | |
aws_credentials=aws_creds, | |
basepath="docs", | |
) | |
files = await s3_bucket.put_directory(local_path="docs") | |
print(files) | |
if __name__ == "__main__": | |
asyncio.run(aws_s3_bucket()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment