rahkarp_layinu
rahkarp_layinu

Reputation: 11

How to delete two security groups referenced by each other?

I was trying to connect to an RDS Instance from an EC2 instance. This resulted in creation of security groups for both of these resources. Now I do not want this connection and have deleted the RDS instance but the security groups still exist. How can I delete them?

When I try to delete them from console it says:

The following security groups can't be deleted. They are either default security groups, referenced by other security groups, or they are associated with instances or network interfaces.
Reason: 1 security group associated

These security groups were also attached to network interfaces earlier which was also a reason for why I couldn't delete them but I was able to disassociate them from these security groups.

Upvotes: 1

Views: 1088

Answers (2)

JAHID
JAHID

Reputation: 11

Try to delete the inbound and outbound rules for that security group and then you will be able to delete your desired security group. That worked for me.

Upvotes: 1

chamal
chamal

Reputation: 983

Delete the particular rule referencing the other security group (or edit to something else) first. This removes the dependency and you'll be able to delete the security group itself.

Upvotes: 4

Related Questions