You may pass wanted steps to cloud-init throughout the user details fields when launching an instance. This implies You need to use common AMIs For most use cases and configure them dynamically at startup. Amazon Linux also takes advantage of cloud-init to complete initial configuration of the ec2-consumer account. Bottlerocket https://shaneacpre.blogdal.com/26544098/linux-server-premium-support-secrets