You need to install Hashicorp Packer and RedHat Ansible. Also you need AWS SDK installed and configured access token in profile ~/.aws/credentials
Packer creates AMI from Ubuntu 20.04 on M6g instance type (Graviton2) and provision via Ansible playbook packer-es.yml
to setup ElasticSearch.
From this AMI you need to create EC2.
packer build elastic-arm.json