Create an EFS and connect it to 3 different EC2 instances
·Jan 24, 2022·
1 min read
Create an EFS and connect it to 3 different EC2 instances. Make sure that all instances have different Operating System. For instance, Ubuntu, Red Hat Linux and Amazon Linux 2.
We can add an EFS to EC2 instances in two ways.
One way is to create EFS first and add it to new EC2 instance. (this is straight forward, all we need is to do is click on add File System under configure instances while creating EC2 instances)
Other way is to attach the EFS to existing EC2 instances. ( Until now AWS doesn’t provide straight forward way to configure this via AWS console. We need to connect to existing EC2 instance and attach it using scripts). We will be using this approach below.