Change security group on AWS RDS Database Instance
Asked Answered
C

6

24

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.

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.

Any idea?

Chloras answered 21/6, 2018 at 3:27 Comment(0)
B
46

Your Amazon RDS database is currently using the "default" security group. 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)

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.

Brutality answered 21/6, 2018 at 4:36 Comment(0)
R
5

To modify the default security group simply follow the next steps

  1. Go to Amazon RDS console

  2. Click on the instance

  3. Click on the security group

  4. Add an inbound rule

enter image description here

Rapallo answered 19/3, 2021 at 12:0 Comment(0)
K
2

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.

Kreiner answered 21/6, 2018 at 4:53 Comment(3)
Yeah I didn't change the default one - I made a new security group. However I don't know how to modify my DB instance to select the new security group. Any idea?Chloras
There is a Modify Button on the detailed screen of the DB Instance, there you can modify and attach the other Security Group that you created.Kreiner
Thanks I've changed it now.Chloras
S
2

I encountered this when trying to move my database to a new VPC. In the AWS console, I was only able to select my created Security Group after switching to my new VPC. You can't do both at the same time.

The options for security group are filtered by the associated VPC, so you must:

  1. Go to RDS > Databases > (Your DB) > Modify.
  2. Change your VPC and apply the changes.
  3. Wait for the change to finish.
  4. Select Modify again. You should see your new Security Group as an option.
Superman answered 20/2, 2023 at 20:41 Comment(1)
This is exactly why I see this problem. Thanks for your solution.Eburnation
B
0

Best option is to modify the security group as this group is already attached to the 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.

Babu answered 21/6, 2018 at 5:36 Comment(0)
K
0

Yes, you can delete the default RDS security group ie (eg. rds-ec2-5 and ec2-rds-5)

step1: go to the security group and select rds-ec2-5 --> and remove all the rule and save

step2: same in ec2-rds-5 --> remove all the rule and save the changes after that you can able to delete the default rule

Karmakarmadharaya answered 6/11, 2023 at 10:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.