User Data = Bash script that runs automatically when EC2 first launches
Automate initial setup:
yum install httpd)yum update)systemctl start httpd)Runs only once at first boot
Runs as root (no need for sudo)
Must start with: #!/bin/bash
Perfect for automation at launch
#!/bin/bash
yum update -y
yum install -y httpd
systemctl start httpd
systemctl enable httpd
echo "<h1>Auto-deployed!</h1>" > /var/www/html/index.html
SSH manually = slow, not scalable
Contact AWS Support = unnecessary