Compiling Node Binaries for ARM architecture
Note: this isn't used,used for Deserted Chateau, as despite the lower cost,GB-second ARMcost of ARM, it has significantly lower performance for Deserted Chateau's use case (image resizing).
Create an Amazon Linux 2 EC2 instance (t4g.nano will do - make sure it's ARM64 architecture, not X86_64).
SSH into it using its public IP and username "ec2-user". Run commands:
sudo yum update
sudo yum install -y gcc-c++ make
curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash -
sudo yum install -y nodejs
Copy your package.json file into the /home/ec2-user/ directory and run:
npm install
ToProviding actuallyyou uploaddidn't get any errors, you can now zip up the fileresulting asnode_modules an ARM64 lambda function, download the AWS CLI, and use command "aws configure" to set IAM keys and region. Then run:folder:
aws lambda update-function-code --function-name imageresizer --zip-file fileb://imageresizer-arm.zip --architecturesr arm64sharp.zip node_modules/
ArchitectureThe parametersharp canbinaries are now ready to be eitheruploaded "x86_64"as fora x86Lambda binaries or "arm64" for arm binaries.layer.