You can delete security groups that are no longer needed. When a security group is deleted, the rules in the security group are also deleted.

Prerequisites

  • A security group that contains Elastic Compute Service (ECS) instances or elastic network interfaces (ENIs) cannot be deleted. You must move the ECS instances or ENIs out of the security group before you can delete the security group. For information about how to move ECS instances or ENIs out of a security group, see Manage ECS instances in a security group or Manage ENIs in a security group.
  • A security group that is referenced as an authorization object by rules in other security groups cannot be deleted. You must follow the on-screen instructions to delete the rules before you can delete the security group. For information about how to delete a security group rule, see Delete a security group rule.

Procedure

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Network & Security > Security Groups.
  3. In the top navigation bar, select a region.
  4. On the Security Groups page, select one or more security groups and click Delete in the lower part of the page.
  5. In the Delete Security Group message, confirm the information and click OK.

References

For information about how to delete security groups by calling an API operation, see DeleteSecurityGroup.