OpenZFS (aka ZFS on Linux) supports different Linux distributions, but Amazon Linux 2 isn't mentioned in the documentation. As the OS is quite close to CentOS / RHEL, you can just follow the steps here: Started/RHEL and CentOS.html

However, the OS package names (and versions) seem to be closer to CentOS 7 than 8, so you have to install the release RPM for CentOS 7.8:

$ sudo yum install
$ sudo yum install "kernel-devel-uname-r == $(uname -r)" zfs
$ sudo modprobe zfs