I checked out this question: https://answers.atlassian.com/questions/157864/elastic-agent-ec2-user-data-vs-instance-startup-script but the OP trailed off, and the answer was not at all detailed.
Running a (very small) risk of this question becoming obsolete tomorrow, I'm referring to Elastic Agents off the ami-976edafe AMI.
Can anyone explain which component on the instance will pick up the script, where it will pick it up from, and what it'll execute it through? My first attempt was passing it data as I would to the agent (cmd/bat-like), but I found no evidence anywhere on the agent instance that anything ran. Should I be passing script or powershell tags (as I would for a modern AWS base Windows AMI)?
Would the answer be any different if I used my own AMI based on today's AWS images (where ec2config would indeed work with script and powershell tags)?
Thank you in advance.