I am unable to deploy a .NET 8 lambda function using aot from my m series mac. I have been following the directions in the documentation here https://docs.aws.amazon.com/lambda/latest/dg/dotnet-native-aot.html but I cannot get it to deploy. The steps work perfectly fine on windows but I get an error when running it on mac.
I run the command dotnet lambda deploy-function and I get the error
Host machine architecture (Arm64) differs from Lambda architecture (X64). Building Native AOT Lambda functions require the host and lambda architectures to match.
The documentation says that the deploy lambda cli command should handle the docker setup but it seems like it's not building it properly. I created my own dockerfiles and specified to use linux-x64 as the target but I still get the same error. What am I missing? Is it really saying that I cannot deploy from my arm computer to aws even when I use docker images?
I have tried creating dockerfiles to make my host environment the same as the target environment but it still throws the error.
You have to specify the architecture that you will use. Could you try to add
-farch arm64option? you can find the options withdotnet lambda deploy-function --helpcommand.