AWS Ec2 Access 是私有 VPC

AWS Ec2 Access which is private VPC

这更像是一个架构问题,而不是编码问题。 如果我在错误的地方请原谅我 我在私有 VPC 中有一个 Ec2 实例 运行,我们将来会在那里 将要部署 PII 数据,但我们绝不能通过互联网访问它。 但是我们需要在 docker(Airflow, docker, nifi, python etc) 中安装 ETL 工具 当然需要从我当地的公司 vpc ssh 进入。

我认为有两种方法

    1. To create an another EC2 in public subnet and install all our tool there 
       and call the VPC EC2 from this one. 
       So that I can move the PII data to S3 through private Endpoint.
    
    Cons: Does not it still raise the security concern as the EC2(ETL) is still
    in internet where from one can access the PII data in second ec2.

另一种选择

2. To create the Ec2 in public and install all tools and then 
    finally change it into private VPC.
    Cons: in case if tool crash or there is any change needed then will have to 
    move it back to public which again does not look proper way of handling it.

我试图在互联网上搜索以获取有关它的任何教程或培训。 但是找不到。

任何建议将不胜感激。

我认为这两种方法本质上都是次优的

如果您只想避免将您的计算实例暴露在互联网上,并且您的设置是基于 docker 的,只需使用 ECS 或 Sonatype 设置您自己的 docker 存储库Nexus(在另一台服务器上),将您的 docker 图像上传到那里,并让该节点使用该 ECS/Nexus 作为其 docker 注册表。

这样一来,您就可以免费访问以 docker 图像形式公开的所有资源,同时保持安全合规性。

如果你不想,你根本不需要使用互联网。我假设 无法访问互联网 你的意思是这是两种方式 - 无法从互联网访问实例,实例也根本无法连接互联网(即没有 NAT 或任何其他代理).

几种方法可以做到这一点。一种方式如下:

  1. 准备 自定义 AMI 并预先安装您需要的所有软件包和软件。
  2. 创建 私有 VPC,不带任何 public 个子网。
  3. VPC 接口端点 添加到 S3、AWS System Manager、ECR(用于存储您的私有 docker 图像)和您可能需要的其他 AWS 服务的 VPC,例如KMS.
  4. 从私有 VPC 中的自定义 AMI 启动您的实例。
  5. 使用 SSM 会话管理器 在没有任何互联网访问权限的情况下“ssh”到实例。