Skip to content

Instantly share code, notes, and snippets.

@gaurish
Created August 20, 2017 19:10
Show Gist options
  • Select an option

  • Save gaurish/ad03481ce9b296951d20ab84850f40f2 to your computer and use it in GitHub Desktop.

Select an option

Save gaurish/ad03481ce9b296951d20ab84850f40f2 to your computer and use it in GitHub Desktop.

Revisions

  1. gaurish created this gist Aug 20, 2017.
    9 changes: 9 additions & 0 deletions userdata.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/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