To Nha Notes | June 23, 2021, 11:31 a.m.
When you launch an instance in Amazon EC2, you have the option of passing user data to the instance that can be used to perform common automated configuration tasks and even run scripts after the instance starts. You can pass two types of user data to Amazon EC2: shell scripts and cloud-init directives. You can also pass this data into the launch wizard as plain text, as a file (this is useful for launching instances using the command line tools), or as base64-encoded text (for API calls).
User Data:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html
Execute UserData on EC2:
https://aws.amazon.com/premiumsupport/knowledge-center/execute-user-data-ec2/