简体   繁体   English

更改 AWS RDS 数据库实例上的安全组

[英]Change security group on AWS RDS Database Instance

I've created a Postgresql database instance via AWS RDS.我已经通过 AWS RDS 创建了一个 Postgresql 数据库实例。 I am now trying to connect to it from my django app, so I created a new security group and changed the imbound rules.我现在试图从我的 django 应用程序连接到它,所以我创建了一个新的安全组并更改了入站规则。

However how do I make this new rule active?但是,如何使这个新规则生效? I go onto my database instance and under "Security Groups" it only says:我进入我的数据库实例,在“安全组”下它只说:

default (sg-9a15a9f0)
( active )

and doesn't show the new security group I created.并且不显示我创建的新安全组。 In the Security Group UI, I can't find a button to make the new security group active.在安全组 UI 中,我找不到激活新安全组的按钮。

Any idea?任何的想法?

Your Amazon RDS database is currently using the "default" security group.您的 Amazon RDS 数据库当前正在使用“默认”安全组。 Therefore, you have two choices:因此,您有两个选择:

  • Modify the default security group, or修改默认安全组,
  • Create a new security group (as your have done), then go to the RDS console, click on your database, then choose Instance actions -> Modify and modify the security groups that are associated with the DB instance (add the new security group, remove the default security group)创建一个新的安全组(如您所做的那样),然后转到 RDS 控制台,单击您的数据库,然后选择实例操作 -> 修改修改与数据库实例关联的安全组(添加新的安全组,删除默认安全组)

Security groups are set up within the EC2 service, so to create a new security group, go to the EC2 service, then click Security Groups on the left, under Network & Security .安全组设置在 EC2 服务中,因此要创建新的安全组,请转到EC2服务,然后单击左侧的Security Groups ,在Network & Security 下

To modify the default security group simply follow the next steps要修改默认安全组,只需按照以下步骤操作

  1. Go to Amazon RDS console转至 Amazon RDS 控制台

  2. Click on the instance点击实例

  3. Click on the security group点击安全组

  4. Add an inbound rule添加入站规则

在此处输入图片说明

Its better to not add open inbound rules to the default security group attached to the DB Instance.最好不要向附加到数据库实例的默认安全组添加开放的入站规则。 Create a new Security group and then Modify your DB Instance where you can select the newly created security group.创建一个新的安全组,然后修改您的数据库实例,您可以在其中选择新创建的安全组。 Note that you can attach more than one Security group to the DB Instance.请注意,您可以将多个安全组附加到数据库实例。

Best option is to modify the security group as this group is already attached to the Postgresql.最好的选择是修改安全组,因为该组已经附加到 Postgresql。

If you don't want to use the default one at all the while creation of postgresql choose the correct SG to avoid this kinds of ambiguity.如果您在创建 postgresql 时根本不想使用默认值,请选择正确的 SG 以避免这种歧义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM