Created
June 29, 2020 17:23
-
-
Save imgeraldalinio/b39afa58d27ca31de2646cf66367f958 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 | |
# To get your AWS Availability Zone where your EC2 instance located | |
AWS_AZ=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone) | |
# Modify your path mount folder directory | |
EFS_MOUNT_DIR=/home/ubuntu/efs | |
# Modify your own EFS endpoint | |
EFS_HOSTNAME=fs-xxxxxxxx.efs.us-west-2.amazonaws.com | |
# Do not replace this fstab directory | |
FSTAB_FILE=/etc/fstab | |
# Command to mount your EFS on fstab | |
$AWS_AZ.$EFS_HOSTNAME:/ $EFS_MOUNT_DIR nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0 >> $FSTAB_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment