Skip to content

Instantly share code, notes, and snippets.

@belminf
Last active November 2, 2016 12:50
Show Gist options
  • Save belminf/60cf6bf58d868a50c905a85b30037368 to your computer and use it in GitHub Desktop.
Save belminf/60cf6bf58d868a50c905a85b30037368 to your computer and use it in GitHub Desktop.
EC2 user-data apache bootstrap
#!/bin/bash
yum update -y
yum install -y httpd jq
service httpd start
chkconfig httpd on
echo "<html><head><title>Test page</title></head><body><h1>From $(curl http://169.254.169.254/latest/dynamic/instance-identity/document 2> /dev/null | jq '.region' | sed 's/"//g' ): Hello world</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