AWS 中托管的两个应用程序

Two applications hosted in AWS

我不知道如何提出这个问题 - 但请相应地进行编辑。

我开发了一个驻留在 AWS 中的应用程序 App1,它连接到由 App1 独家使用的第三方开发的 App2。 App2 也位于 AWS 中。 App2 向 Internet 公开 Web 服务,App1 连接到它。

App1 - 欧洲西部

App2 - 欧盟中心

我的问题是,由于 App1 和 App2 位于 AWS 中,我可以在不访问 Internet 或离开 AWS 网络的情况下与 App2 的网络服务通信吗?

According to Amazon:

Inter-region VPC peering connections allow secure communication between VPC resources in different AWS Regions. All network traffic between regions is encrypted, stays on the AWS global network backbone, and never traverses the public internet, thereby reducing threat vectors, such as common exploits and DDoS attacks. VPC peering is appropriate for many scenarios, for example, to provide VPCs full access to each other’s resources or to provide a set of VPCs partial access to resources in a central VPC. You can configure peering connections to provide access to part of a CIDR block or to an entire CIDR block of the peer VPC.

This Amazon blog post gives you a step by step tutorial and you can find more detailed information on Amazon VPC peering page.

当然可以。方法如下:

  1. 在欧美地区创建虚拟私有云(VPC)并托管 App1 在那里,如果它还没有在 VPC 中。
  2. 在 eu-central 创建一个 VPC 并 托管 App2,与上一步相同。
  3. 在 VPC1 和 VPC2 之间创建 Peering Connection
  4. 修改 App1 和 App2 子网中的路由表指向 通过对等连接的流量。
  5. 配置App1访问 通过 IP 的网络服务。您也可以花点心思使用 Route 53 来 为 App2 网络服务创建私有 DNS 记录。

绝对可以,使用相对较新的 AWS PrivateLink for Customers and Partners,这是比以前的 VPC 对等选项更简洁的解决方案。

  1. 在 App2(服务提供商 AWS 帐户)中,创建一个指向您要使用的 Web 服务实例的 NLB(网络负载均衡器)。 (EC2 > 负载均衡器 > 创建 > NLB)
  2. 在 App2 中,创建一个服务端点以使其可供其他 AWS 账户使用。 (VPC > 端点服务 > 创建)

    • 设置策略以仅允许 App1 帐户 ID 访问服务。
    • 记下服务名称。
  3. 在 App1(服务消费者 AWS 账户)中,将来自 App1 的服务端点添加为 VPC 端点。 (VPC > 端点 > 创建 > 按名称查找服务)

  4. 然后您需要在 App2 中接受新请求

这是更详细的设置指南:https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html