Skip to content

Instantly share code, notes, and snippets.

@gaurish
Created August 20, 2017 19:10
Show Gist options
  • Save gaurish/ad03481ce9b296951d20ab84850f40f2 to your computer and use it in GitHub Desktop.
Save gaurish/ad03481ce9b296951d20ab84850f40f2 to your computer and use it in GitHub Desktop.
#!/bin/bash
yum update -y
yum install httpd24 -y
service httpd start
chkconfig httpd on
EC2_AVAIL_ZONE=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id/`
echo "<html><body><h1>Hello, this is Instance ID
${INSTANCE_ID} located in ${EC2_AVAIL_ZONE}</h1></body></html>" > /var/www/html/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment