Skip to content

Instantly share code, notes, and snippets.

@danilop
Created November 11, 2015 12:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save danilop/6d49e2b6507f748a00a9 to your computer and use it in GitHub Desktop.
Save danilop/6d49e2b6507f748a00a9 to your computer and use it in GitHub Desktop.
Amazon EC2 - user data to automatically mount an Amazon EFS file system at boot (Linux)
#cloud-config
package_upgrade: true
packages:
- nfs-utils
- httpd
- php
runcmd:
- echo "$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).FILE_SYSTEM_ID.efs.us-west-2.amazonaws.com:/ /var/www/html/efs nfs4 defaults" >> /etc/fstab
- mkdir /var/www/html/efs
- mount -a
- service httpd start
- chkconfig httpd on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment