Skip to content

Instantly share code, notes, and snippets.

@shamal
Last active November 9, 2022 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shamal/10c918c72cc5e6b7c6d68e46403c223d to your computer and use it in GitHub Desktop.
Save shamal/10c918c72cc5e6b7c6d68e46403c223d to your computer and use it in GitHub Desktop.
AWS EC2 Userdata: httpd, mount EFS, write index.html
#!/bin/bash
yum update -y
yum install httpd -y
chkconfig httpd on
sudo yum install -y amazon-efs-utils
sudo mount -t efs YOUR_EFS_ENDPOINT:/ /var/www/html
echo '<html><h1>Hello World!</h1><html>' > /var/www/html/index.html
service httpd start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment