I have been successfully utilizing AWS's Javascript SDK to launch custom EC2 instances, which has worked well so far.
Now, I am looking to make these instances capable of running specific tasks upon creation, such as cloning a repository from Github, installing a software stack, and configuring various services.
This is in line with the process I follow for deploying local virtual machines, where I use Ansible provisioning scripts to handle similar tasks.
Given my requirements, which AWS service would be most suitable for accomplishing this using the AWS Javascript SDK?
Is there a way to create a template script that can accept runtime variables to execute tasks on the newly created instance? I have heard about the user-data
, but I am unsure how it integrates with the AWS SDK and if it offers enough customization options.
In essence, I am seeking a method to utilize the SDK to achieve the following:
"Execute this script on the newly created instance, located here, replacing placeholder values with the input provided at runtime."
Any suggestions or tips on how to approach this challenge?