Last active
June 26, 2020 15:17
-
-
Save amcginlay/d6a3e2468a1f777a47f8cfa06a065a37 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
yum update -y | |
yum install -y nfs-utils | |
FILE_SYSTEM_ID=fs-xxxxxxxx | |
AVAILABILITY_ZONE=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone ) | |
REGION=${AVAILABILITY_ZONE:0:-1} | |
MOUNT_POINT=/mnt/efs | |
mkdir -p ${MOUNT_POINT} | |
chown ec2-user:ec2-user ${MOUNT_POINT} | |
echo ${FILE_SYSTEM_ID}.efs.${REGION}.amazonaws.com:/ ${MOUNT_POINT} nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,_netdev 0 0 >> /etc/fstab | |
mount -a -t nfs4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment