AWS / Basics / EC2- lanch EC2 with bash user data script
Lanch EC2 with bash user data script
-
STEPS
1. create EC2 instance
2. in the advance setting section, there is option to add bash script. The given example is for creating web server and create index.html
#!/bin/bash sudo su yum -y install httpd echo " My Instance!
" >> /var/www/html/index.html sudo systemctl enable httpd sudo systemctl start httpd