postgresql 更改 AWS RDS 数据库实例上的安全组
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50959948/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Change security group on AWS RDS Database Instance
提问by Zorgan
I've created a Postgresql database instance via AWS RDS. I am now trying to connect to it from my django app, so I created a new security group and changed the imbound rules.
我已经通过 AWS RDS 创建了一个 Postgresql 数据库实例。我现在试图从我的 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?
任何的想法?
回答by John Rotenstein
Your Amazon RDS database is currently using the "default" security group. Therefore, you have two choices:
您的 Amazon RDS 数据库当前正在使用“默认”安全组。因此,您有两个选择:
- Modify the defaultsecurity 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 -> Modifyand modify the security groupsthat are associated with the DB instance (add the new security group, remove the defaultsecurity group)
- 修改默认安全组,或
- 创建一个新的安全组(如您所做的那样),然后转到 RDS 控制台,单击您的数据库,然后选择实例操作 -> 修改和修改与数据库实例关联的安全组(添加新的安全组,删除默认安全组)
Security groups are set up within the EC2 service, so to create a new security group, go to the EC2service, then click Security Groupson the left, under Network & Security.
安全组设置在 EC2 服务中,因此要创建新的安全组,请转到EC2服务,然后单击左侧的Security Groups,在Network & Security 下。
回答by Mahtab Alam
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.
最好不要将开放的入站规则添加到附加到数据库实例的默认安全组中。创建一个新的安全组,然后修改您的数据库实例,您可以在其中选择新创建的安全组。请注意,您可以将多个安全组附加到数据库实例。
回答by Dharmendra Kumar
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 以避免这种歧义。