如何为 Elastic Beanstalk 设置 VPC [英] How to set up a VPC for Elastic Beanstalk

查看:28
本文介绍了如何为 Elastic Beanstalk 设置 VPC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的 Elastic Beanstalk Web 应用程序和 RDS postgres db 设置一个VPC.我尝试创建 VPC,但遇到了问题:

I want to set up a VPC for my Elastic Beanstalk web app and RDS postgres db. I tried creating a VPC but ran into problems:

我去了AWS上的VPC ->启动 VPC 向导 ->具有公共和私有子网的 VPC.我不确定要使用什么配置.例如,我应该如何设置Elastic IP Allocation ID?需要设置VPC名称吗?

I went to VPC on AWS -> Launch VPC Wizard -> VPC with Public and Private Subnets. I am not sure what configurations to use. For example, what should I set Elastic IP Allocation ID? Do I need to set the VPC name?

创建此文件后,我是否准备好将其添加到 EBS 和 RDS 中,或者我还需要做些什么?谢谢!

推荐答案

是否需要设置 VPC 名称?

Do I need to set the VPC name?

它是可选的,但您可以使用,例如MyVPCforEB 或您想要的.通过名称找到您的 vpc 比通过神秘的 vpc-id 更容易.

Its optional, but you can use, e.g. MyVPCforEB or what you want. It easier to find your vpc by name, than by cryptic vpc-id.

我应该如何设置弹性 IP 分配 ID

what should I set Elastic IP Allocation ID

您必须先创建 EIP.它在 VPC -> 中完成弹性 IP 地址 菜单.这是 NAT 网关所必需的,以便私有子网中的实例可以访问 Internet.

You have to create EIP first. Its done in VPC -> Elastic IP addresses menu. This is required for NAT gateway, so that instances in private subnet can access the internet.

创建此文件后,我是否准备好将其添加到 EBS 和 RDS 中,或者还有什么我需要做的吗?

After I create this, am I ready to just add it in EBS and RDS, or is there something else I need to do?

并非如此.要正确执行此操作,您需要再添加一个私有子网.VPC 向导将仅创建一个私有子网.对于 RDS,要创建子网组,您需要在不同的可用区中至少有两个私有子网.

Not really. To do it properly, you would need to add one more private subnet. The VPC wizard will create only one private subnet. For RDS, to create a subnet group, you need to have at least two private subnets in different Availability Zones.

因此,一旦您在两个不同的可用区中拥有两个私有子网,您就可以使用这些子网在 RDS 中创建新的Subnet Group.有了这个,您就可以在这两个子网中创建 RDS.

Thus, once you have two private subnets in two different AZs, then you can create new Subnet Group in RDS with the subnets. Having this, you can create the RDS in these two subnets.

这篇关于如何为 Elastic Beanstalk 设置 VPC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆