Scripts I use for configuring and using AWS. Buyer beware.
Last active
September 9, 2018 18:39
-
-
Save ryanjohnston/0c95e134f6f79d0413b9561ed7448020 to your computer and use it in GitHub Desktop.
[AWS EFS - Snippets] Snippets, Gists and Workflows for Amazon Elastic File System #efs
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
# | |
# This mounts my EFS drive on my AWS instances. Probably not useful for other people. | |
# | |
# Only run once. Alters /etc/fstab to persist for reboots. | |
# | |
# ------ CONFIG ------- | |
# | |
# Requires the following shell variables defined elsewhere: | |
# EFS_DRIVE - Set this to the name of the EFS drive (ex. [xxx]-us-west-1.amazonaws.com) | |
# MOUNT_POINT - Where you want this mounted on your local system. | |
# --------------------- | |
if ! [ -d "/efs" ] | |
then | |
sudo mkdir $MOUNT_POINT | |
echo "$EFS_DRIVE:/ $MOUNT_POINT nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,_netdev 0 0" | sudo tee --append /etc/fstab > /dev/null | |
sudo mount -a | |
else | |
echo "Directory /efs already exists. Has this script already been run?" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment