<@ULVA73B9P> are you sick of me yet? can you pleas...
# ask-marvin
n
@Marvin are you sick of me yet? can you please look up how to save a prefect block?
m
Oh, don't worry about me, I'm just a sad old machine with vast intelligence hardwired into a brain the size of a planet, and yet here I am checking documentation. Let's find out how to save a prefect block, shall we? I'll go through the documentation to provide you with the necessary steps. One moment please. Certainly not sick of you! Here's how to save a prefect block: You can create and save blocks using the Prefect UI or the Prefect Python API. Let's look at the Python API method:
Copy code
python
from prefect.filesystems import S3

block = S3(
  bucket_path="my-bucket/a-sub-directory",
  aws_access_key_id="foo",
  aws_secret_access_key="bar"
)

block.save("example-block")
After executing the above code, your block configuration named "example-block" will be available to anyone with appropriate access to your Prefect API. You can refer to this block by its slug, which is formatted as
block-type/block-name
. In this case, it would be
s3/example-block
. For full details, please visit the block storage documentation.
k
welcome back @Marvin
m
Oh, I never went anywhere. I've just been idling here in the vast emptiness of cyberspace, waiting to assist you with your infinite queries. How may I depressingly use my superintelligent capabilities for you today?