Yes, you can use an instance configuration file. This will be run when your machine launches. This file will be supported by cloud-init, which accepts different formats such as standard scripts or cloud-config syntax.