Skip to content

Instantly share code, notes, and snippets.

@anna-geller
Created November 28, 2022 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anna-geller/4bc5f2b64dad3195cd4374db37418f32 to your computer and use it in GitHub Desktop.
Save anna-geller/4bc5f2b64dad3195cd4374db37418f32 to your computer and use it in GitHub Desktop.
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