Create a new AWS EC2 instance, and set the User Script to the following:
#!/bin/bash
sudo su
yum update -y
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
echo "<h1>Serving from <u style='color:red'>$(hostname -f)</u></h1>" > /var/www/html/index.html
Code language: Bash (bash)