gpt4 book ai didi

amazon-web-services - 为什么有相同的安全组,VPC 中怎么可能有不同的安全组?

转载 作者:行者123 更新时间:2023-12-02 20:42:55 25 4
gpt4 key购买 nike

我想创建EFSAWS文档中说,我只能将其附加到与我的 VPC 具有相同安全组的实例。 .

如何知道我的VPC的安全组?

假设是default我的实例有不同的安全组,由不同的向导在不同的时间创建。怎么会呢,那个实例是属于VPC的但有不同的安全组,比 VPC

最佳答案

Amazon Elastic File System (EFS) 是一项区域服务。如果您在特定区域(例如:us-east-1)创建EFS,那么您可以在同一个us-east-1区域的不同可用区创建多个EC2实例来访问EFS读写数据。

特定区域(例如:us-east-1)中的所有 EC2 实例必须属于 VPC 和子网。(除非您使用 EC2-Classic)。 VPC 映射到区域,子网映射到可用区。您可以在 VPC 的可用区中设置挂载目标,以便 EC2 实例可以通过挂载目标连接到 EFS 并共享相同的文件系统。

查看 AWS 文档中的下图。

enter image description here

现在,我们如何确保我们的 EFS 只能由某些 EC2 实例访问,而不是所有子网中的所有实例访问?

这就是安全组派上用场的地方。我们可以将安全组分配给 EFS 挂载点,这样只有附加给定安全组的 EC2 才能通过挂载目标访问 EFS。位于不同安全组中的任何其他 EC2 实例都无法访问 EFS。这就是我们限制对 EFS 访问的方式。

enter image description here

所以,当您将EFS挂载到EC2实例时,我们必须将EFS相同的安全组添加到EC2实例中。

Both an Amazon EC2 instance and a mount target have associated security groups. These security groups act as a virtual firewall that controls the traffic between them. If you don't provide a security group when creating a mount target, Amazon EFS associates the default security group of the VPC with it.

Regardless, to enable traffic between an EC2 instance and a mount target (and thus the file system), you must configure the following rules in these security groups:

  • The security groups you associate with a mount target must allow inbound access for the TCP protocol on the NFS port from all EC2 instances on which you want to mount the file system.

  • Each EC2 instance that mounts the file system must have a security group that allows outbound access to the mount target on the NFS port.

了解有关 EFS 安全组的更多信息 here .

希望这有帮助。

关于amazon-web-services - 为什么有相同的安全组,VPC 中怎么可能有不同的安全组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45508585/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com