Note: Before we going ahead you have to follow 1-9 steps using below link.
https://www.cloudjojo.com/how-to-create-ebselastic-block-store-in-aws
Step 10. Use below commands to create swap on our system.
# mkswap -f /dev/xvdf
Step 11. Now we have to on that swap on our system by below command.
# swapon /dev/xvdf
Step 12. To make it enable on system boot, simply edit /etc/fstab file and add following entry at end of file.
#vim /etc/fstab
/dev/xvdf swap swap defaults 0 0
/dev/xvdf swap swap defaults 0 0
Step 13. Run below command to mount your volume permanently
# mount -a
Step 14. To check your mounted volume run below command
# free -m
Note: Your swap partition is successfully configured.