Though it is not possible to compile and run your own kernels on Amazon EC2, it is possible to compile and run your own kernel modules and bundle them with your EC2 images. The trick is that the kernel modules need to be compiled with exactly the same kernel source and compiler versions as were used to build the original kernel.
The steps below were used to build the updated 2.6.21 kernel modules for the Ubuntu and Debian AMIs listed at https://alestic.com