Amazon linux AMI vs Ubuntu

Amazon Linux AMI based on CentOS 6.x, whereas Amazon Linux 2 is CentOS 7.x,

So instead of apt you would use yum,

and instead of /usr/local/bin/composer you'll have to use /usr/bin/composer

...


Amazon Linux AMI is a red hat based distro so things like the package installer or the tools for service manage are different, and another thing you need to consider is the way of bootstraping, amazon instances are more flexible to do some things in cloudformation in the ubuntu way the best form to do it is with cloudinit https://help.ubuntu.com/community/CloudInit, you need to consider the packages too are multiple packages that not are native supported by Amazon Linux.