0

I have two instances in two private subnets associated to different security groups. How can I transfer files between them in an "NFS manner"?

Caterina
  • 775
  • 9
  • 26
  • What do you mean "nfs manner"? You can allow access from another sec group or open ports – gusto2 Oct 25 '21 at 18:24
  • That they have access to a certain directory of the other instance. I suppose we can do this with FTP, however I am not sure where to put the FTP server if I want a double-ended file transfer. Can a single instance be both a FTP server and a client? Should I use a bastion host instead as a FTP server between them? – Caterina Oct 25 '21 at 18:33
  • 1
    All options are possible. However, when you mentioned NFS, maybe using AWS EFS could be an option. It is managed (you don't need to have a separate server) and can be shared between instances – gusto2 Oct 25 '21 at 18:43
  • Hey thanks! This is a great idea!! Just to confirm, this can be done for different security groups right? – Caterina Oct 25 '21 at 18:55

1 Answers1

2

I have two instances in two private subnets associated to different security groups.

In a security group you may specify as a source another security group. You can configure two groups to allow traffic from each other, but that creates a circular reference. It will work, but then it's cumbersome to automate or update the group configuration.

Better to create another sec-group trusting the traffic from itself (see how the defaut sg is created) and assign the new sec group the both instances (it is possible to assign multiple sg). Assuming the private subnets are in the same VPC.

if I want a double-ended file transfer. Can a single instance be both a FTP server and a client? Should I use a bastion host instead as a FTP server between them?

You can have both instances serving as a client and server the same time, nothing wrong with that. However - if you want to have a shared, reliable and "NFS-like" transfer, I'd suggest using the AWS EFS (or EFSx if using Windows) what is a managed NFS storage.

gusto2
  • 11,210
  • 2
  • 17
  • 36