We made --localrpm option to automatically build rpms from sourcecode, but we actually use the option to produce AMI using prebuilt rpm on our CI. To simplified the script, and to prevent accsidently start rpm build in the script, drop rpm build part.
Edit variables.json and run dist/ami/build_ami.sh, it will build & upload AMI.
When deploying the AMI, be sure to add two more disks(sdb, sdc) to construct RAID.