Skip to main content

Compiling Node Binaries for ARM architecture (unused)

Note: this isn't used for Deserted Chateau,used, as despite the lower GB-secondcost, cost of ARM, itARM 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

ProvidingTo youactually didn't get any errors, you can now zip upupload the resultingfile node_modulesas folder:an ARM64 lambda function, download the AWS CLI, and use command "aws configure" to set IAM keys and region. Then run:

aws lambda update-function-code --function-name imageresizer --zip-file fileb://imageresizer-arm.zip -r-architectures sharp.zip node_modules/arm64

TheArchitecture sharpparameter can be either "x86_64" for x86 binaries areor now"arm64" readyfor toarm be uploaded as a Lambda layer.binaries.