Skip to main content

Compiling Node Binaries for ARM architecture (unused)

Note: this isn't used, as despite the lower cost, ARM 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

To actually upload the file as 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 --architectures arm64

Architecture parameter can be either "x86_64" for x86 binaries or "arm64" for arm binaries.