1
votes

I am trying to mount EFS to amazon beanstalk with EBS script. storage-efs-createfilesystem.config But that script is not able to find an environment so below 3 lines are failing and says no such file or directory. Code:

EFS_REGION=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.REGION')
EFS_MOUNT_DIR=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.MOUNT_DIRECTORY')
EFS_FILE_SYSTEM_ID=$(/opt/elasticbeanstalk/bin/get-config environment | jq -r '.EFS_ID')

ERROR:

2020-07-22 16:51:24,595 P5115 [INFO] Command 01_mount 2020-07-22 16:51:24,627 P5115 [INFO] -----------------------Command Output----------------------- 2020-07-22 16:51:24,628 P5115 [INFO] /tmp/mount-efs.sh: line 3: /opt/elasticbeanstalk/bin/get-config: No such file or directory 2020-07-22 16:51:24,628 P5115 [INFO] /tmp/mount-efs.sh: line 4: /opt/elasticbeanstalk/bin/get-config: No such file or directory 2020-07-22 16:51:24,628 P5115 [INFO] /tmp/mount-efs.sh: line 5: /opt/elasticbeanstalk/bin/get-config: No such file or directory 2020-07-22 16:51:24,628 P5115 [INFO] Mounting ITE EFS filesystem to directory ... 2020-07-22 16:51:24,628 P5115 [INFO] Stopping NFS ID Mapper... 2020-07-22 16:51:24,628 P5115 [INFO] rpc.idmapd is already stopped!

1

1 Answers

1
votes

The error occurs beacause you are using Amazon Linux 2 (AL2) as your EB platform.

However, your script tries to use /opt/elasticbeanstalk/bin/get-config which works only in AL1.

Thus you either have to modify you script to work in AL2, or use old EB platform which is based on AL1.