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. This topic describes how to delete a security group in the Elastic Compute Service (ECS) console.
Prerequisites
The security group that you want to delete does not contain ECS instances or elastic network interfaces (ENIs). If the security group contains ECS instances or ENIs, you cannot delete the security group. Move the ECS instances or ENIs out of the security group before you can delete the security group. For more information, see Manage ECS instances in a security group or Manage ENIs in a security group.
The security group that you want to delete is not referenced as an authorization object by security group rules in other security groups. If the security group is referenced as an authorization object by security group rules in other security groups, you cannot delete the security group. Delete the security group rules before you delete the security group. For more information, see Delete a security group rule.
Procedure
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
On the security group list page, delete one or more security groups.
To delete a single security group, find the security group and click Delete in the Operation column.
To delete one or more security groups at a time, select the security groups and click Batch Delete in the lower part of the page.
In the Delete Security Group message, confirm the information and click Confirm.
References
You can also call the following API operation to delete security groups: DeleteSecurityGroup.