AWS Storage Blog
Automate mounting Amazon EFS File Systems from the EC2 Launch Instance Wizard
Customers have provided us with great feedback on previous posts covering best practices and integrations for using Amazon Elastic File System (EFS) with other AWS services, and they have been asking for more. Today, I’ll show you how you can simplify and automate the mounting of Amazon EFS file systems to EC2 instances directly from the EC2 Launch Instance Wizard. I hope you’ll add this to your EFS cookbook, along with last month’s best practices for using EFS to accelerate and simplify model training with Amazon Sagemaker, and using EFS for container storage with Amazon Elastic Container Service (ECS) and Elastic Kubernetes Service (EKS).
Amazon EFS provides a simple, scalable, elastic NFS file system for Linux-based workloads for use with AWS Cloud services and on-premises resources, at an effective price of just $0.08/GB-month*. Thousands of EC2 instances can mount an EFS file system and share file data. You can now configure Amazon EC2 instances to mount Amazon EFS file systems using the EC2 Launch Instance Wizard. This will simplify the process of configuring EC2 instances to mount your EFS file systems on boot with recommended mount options. I’ll show you below how you can quickly and easily create new file systems, or have existing ones mount automatically to your EC2 instances using the EC2 Launch Instance Wizard.
You can choose to either create a new file system, or select from your existing file systems, to automatically mount to your EC2 instances. All of the previous manual tasks, such as launching and connecting to an EC2 instance, ensuring the appropriate file system client is installed and manually executing commands to mount the file system to your EC2 Instance, and updating the “/etc/fstab” file of the EC2 instance to ensure that the file system mounts automatically when the Amazon EC2 instance reboots are all automatically taken care of for you. If you use Amazon Linux, we’ll install the EFS mount helper automatically and mount via TLS. With other operating systems, we’ll ensure NFS utilities are installed and mount using recommended mount options.
To get started, open the EC2 Launch Instance Wizard and select the EFS file system you want to mount from Step 3: Configure Instance Details, or click Create new file system.
In this section, you will select which file systems to mount, and which path to mount it to. If creating a new file system, you will be directed to the EFS console to create your new file system. Once the file system is available, use the refresh button to see the new file systems as mount options on the Configure Instance Details page.
Once you have made your selections, you will click Add to User Data, which will generate a user data script used during the initial boot process to setup the EFS mounts, and persist them across reboots. Click Advanced Details to see the User Data generated by your file system selections.
Once you have made your selections, you will click Add to User Data, which will generate a user data script used during the initial boot process to setup the EFS mounts, and persist them across reboots. Click Advanced Details to see the User Data generated by your file system selections.
Continue with the rest of the wizard. When you are ready to launch, click Review and Launch. Once your instance has launched, your EFS file systems will be mounted at the locations specified, and the settings will persist across instance reboots.
Amazon EFS file systems are often used for web serving and content management, application development and testing, media and entertainment workflows, machine learning and data science notebooks, database backups, container storage, and enterprise applications that utilize shared storage. Customers for these, and many other use cases can save time, and reduce potential errors by eliminating manual configuration steps. Please let us know by commenting below if you have more ideas for how to make Amazon EFS easier to use with other AWS services.
To learn more, see the EC2 Launch Instance Wizard documentation and the Amazon EFS documentation.
*Pricing in the US East (N. Virginia) region. See the Amazon EFS Pricing page for prices in other regions.