如何为EBS和RDS创建VPC? [英] How can I create a VPC for EBS and RDS?

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

问题描述

我制作了一个Django应用并将其部署在Elastic Beanstalk上.我也用RDS制作了一个Postgres数据库.我想将它们都添加到VPC.

我使用 VPC向导(带有公共子网和私有子网的VPC)创建了VPC:顾名思义,该向导创建了一个公共VPC和一个私有VPC

此处告诉了我为RDS添加第二个专用子网.现在我有:

1 public subnet (10.0.0.0/24)
2 private subnets (10.0.1.0/24 and 10.0.10.0/24)

我还从此处知道我需要修改新的专用子网的路由表以指向NAT网关".但是,我不确定这意味着什么.现在,这是我的路线表:

One for the public subnet
One for the private subnet (main)

此外,在配置了此功能之后,我需要怎么做才能将我的RDS添加到其中?在配置RDS时,是否应该仅使用这两个专用子网创建一个子网组并对其进行设置?我想我知道如何使用CLI进行EBS.

如果您需要更多信息,请告诉我!谢谢!

解决方案

对于私有子网,路由表应将0.0.0.0/0指向NAT网关,如屏幕截图所示:

用于RDS进行测试的示例SG:

I made a Django app and deployed it on Elastic Beanstalk. I made a Postgres DB with RDS as well. I want to add both of these to a VPC.

I created the VPC using the VPC wizard (VPC with Public and Private Subnets): which created, as the name suggests, one public and one private VPC.

I was told here that I need to add a second private subnet for RDS. Now I have:

1 public subnet (10.0.0.0/24)
2 private subnets (10.0.1.0/24 and 10.0.10.0/24)

I also know that from here that I needed to "modify the route table of the new private subnet to point to the NAT gateway". However, I am not sure what that means. Right now, here is what my route tables look like:

One for the public subnet
One for the private subnet (main)

Also, after configuring this, what do I need to do to add my RDS to this? Should I just make a subnet group with these 2 private subnets and set it when configuring the RDS? I think I know how to do EBS using CLI.

Please let me know if you need any more information! Thanks!

解决方案

For the private subnets your route tables should point 0.0.0.0/0 to NAT gateway, as shown on the screenshot:

Example SG for RDS for testing:

这篇关于如何为EBS和RDS创建VPC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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