Does Anyone know something like ebextensions[2] in EC2 for AWS Lambda?
The goal is to install custom fonts in the AWS Lambda execution environment.
A lot of the answer on this subject of using fonts on Lambda's were a bit incomplete.
My scenario required using a custom font in conjunction with Imagemagick. I checked out out this branch with Imagemagick and Freetype support and worked through the README. The key for my use case is the lambda or lambda layer used in the function needed freetype support to access my fonts. I'm using a TTF.
After deploying the lambda layer, in my Lambda function's directory I did the following:
fonts
directory.
fonts
directory add the TTF or your font.
/var/task/fonts
.fonts
directory include the following fonts.conf
.
/var/task/fonts/
/tmp/fonts-cache/
package:
include:
- fonts/**
Because freetype is now accessible in the lambda layer any fonts in the fonts directory will be accessible. Could have also dynamically downloaded fonts needed, but I decided to choose include in my lambda function.