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: https://openzfs.github.io/openzfs-docs/Getting 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 http://download.zfsonlinux.org/epel/zfs-release.el7_8.noarch.rpm
$ sudo yum install "kernel-devel-uname-r == $(uname -r)" zfs
$ sudo modprobe zfs