Why it matters
Most functions written in Python, Node.js, Java, Go or .NET run on arm64 with no code changes, so the switch is often just a configuration and build change.How nOps finds it
nOps reads the last 7 days of on-demand Lambda billing for x86_64 compute (GB-seconds) per function. The saving is that cost times the difference between the arm64 and x86_64 list prices in the region (first pricing tier). Usage covered by Savings Plans is left out, and so are savings under $5 a month.Before you start
Arm64 builds of any native dependencies, layers or container images the function uses.How to implement
- Check the function’s dependencies and layers for x86-only native code (compiled libraries, binaries).
- Rebuild the deployment package or container image for arm64.
- Deploy it with the arm64 architecture (Lambda console: Code → Runtime settings → Edit → Architecture, or
aws lambda update-function-code --function-name NAME --architectures arm64 --zip-file fileb://package.zip). - Test the function and compare duration, since run time can change slightly.
- Set the architecture in your SAM, Serverless Framework, Terraform or CloudFormation template.
Risks and considerations
- Functions with x86-only native dependencies or layers fail on arm64 until those are rebuilt.
- Duration can change on arm64, which changes the real saving in either direction.
- To roll back, deploy the x86_64 package with the x86_64 architecture again, or shift an alias back to the previous version.
FAQs
Do I need to change my code?
Do I need to change my code?
Usually not for interpreted languages. Compiled code and native libraries need an arm64 build.