https://prefect.io logo
Title
p

Prasanth Kothuri

02/20/2023, 5:14 PM
Hi , how can I create a S3-compliant storage block in prefect 2.0, to access that storage in boto3 I do the following
s3 = boto3.resource('s3',
                    aws_access_key_id=access_key,
                    aws_secret_access_key=secret_key,
                    endpoint_url=endpoint_url)
got it ! it has to be with Remotefilesystem as below, code if anyone is confused like me
from prefect.filesystems import RemoteFileSystem

storage_block = RemoteFileSystem(
  basepath="<s3://prefect2-flows-dev>",
    settings=dict(
      use_ssl=False,
      key="AAAA",
      secret="BBB",
   client_kwargs=dict(endpoint_url=f"<https://abc.ac.uk>"),
      ),
    )

storage_block.save("flow-storage")
👍 1