I don't know what language you're using on Lambda that requires x86 compilation, but if you search the web for "cross-compiling" you'll find relevant results. For example, here's someone using Graviton ARM to compile Rust for Lambda x86:
https://burgers.io/cross-compile-rust-from-arm-to-x86-64You don't actually need to run the same architecture you compile for, you just need a toolchain and environment that matches your target and a compiler for your machine's architecture that knows how to write to your target architecture.
It sounds more complicated than it is, really. How you go about doing this might vary by language, but as Docker for M1 takes off, you'll see more and more guides for doing "hard" things like compiling to x86.
Also, if you find that you're building Docker images on x86 machines and want to build Docker images for Arm as well, have a look at https://docs.docker.com/buildx/working-with-buildx/#build-mu... for example.