Update AMI build script

Review 1657 by @Tryneus