https://prefect.io logo
p

Prasanth Kothuri

03/31/2022, 2:19 PM
Hello, is there an example of how I add s3 file as an attachment to prefect email task , I looked at the code and the current attachments param only support local uri , TIA
k

Kevin Kho

03/31/2022, 2:27 PM
I haven’t seen a ready example. You’d have to make your own version of the task and modify the existing task. I think you’d need to download that s3 file first
a

Anna Geller

03/31/2022, 2:58 PM
@Prasanth Kothuri sending attachments in automated email tasks is difficult since attachments are generally considered a security risk. Is there any reason you couldn't send just a link to the S3 object in your email text message? I remember I had a similar use case in the past and solved it using presigned URLs in S3. Basically, you send a normal email message, but within your message, you send a presigned URL that allows downloading the S3 object with a single click from within the email with no extra authentication because the URL is already presigned to be authenticated for up to 6 hours. LMK if you are interested in seeing an example.
p

Prasanth Kothuri

03/31/2022, 3:02 PM
thats a great idea, our s3 is based on openstack ceph storage, I will check if we have presigned URL functionality
a

Anna Geller

03/31/2022, 3:03 PM
This is an S3 feature available to everyone :)
here is an example from my older blog post
p

Prasanth Kothuri

03/31/2022, 3:06 PM
you are right I could do that with
s3cmd signurl
so any API would work as well, thanks a ton
👍 1
29 Views