Created
November 11, 2015 12:33
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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