I am trying to mount the EFS with EC2 and what I have done is created the EFS on private subnet and EC2 on public subnet. The private and public subnets are in different availability regions for example us-east-1 and us-east-2.
I am able to connect the EC2 and EFS if putting both of them in public network.As per the official AWS docs its says
"Ensure that there's an Amazon EFS mount target in the same Availability Zone as the Amazon EC2 instance"
I don't want to put the EFS in public subnet.
When mounting the EFS to the EC2 I am getting this error message:
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-b3XXXXXXXXXXXXXXXXX.amazonaws.com:/ /mnt/wordpress
mount.nfs4: Failed to resolve server fs-b3XXXXXXXXXXXXXXXXX.amazonaws.com: No address associated with hostname
The dhcp and dns related settings for VPC are all turned on.