base64encode in StepFunction

0

Is there anyway to base64encoder a string with more than 10,000 character. Currently, AWS State Language supports base64encode function but there is a limit for that. How it's possible to base64encoder without using any lambda in StepFunction? Is there any resource exists in AWS to do the base64encode?

I have a StepFunction which read the file from S3 Bucket (getObject) and I want to attach the file to an Email by using the SendRawEmail and for that I need to base64 encode the file.

Maybe I can use Athena by using the to_base64(to_utf8('FILEDATA')) !

asked 10 months ago252 views
1 Answer
0

Hi, you're right in the fact that there is a 10k limit for base64encode in AWS State Language. So, you may want to pre-encode you file: you can have a S3 Lambda activated when the original file is written to the bucket. This Lambda will encode the original file to a base64 version with a standard naming convention.

Then. when your Step function will attach to attach the original file, it shift the name to the name of the encoded one using the convention and attach this one.

S3 with Lambda: https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html

profile pictureAWS
EXPERT
answered 10 months ago
profile picture
EXPERT
reviewed 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions