Updated on 2024-08-07 GMT+08:00

Deleting a Security Group

Scenarios

If your security group is no longer required, you can delete it.

Both default and custom security groups are free.

Notes and Constraints

  • The default security group is named default and cannot be deleted.
    Figure 1 Default security group
  • If you want to delete a security group that is associated with instances, such as cloud servers, containers, and databases, you need to remove the instances from the security group first. For details, see Adding an Instance to or Removing an Instance from a Security Group.

    If you want to know the instances associated with a security group, refer to How Do I Know the Instances Associated with a Security Group?

  • A security group cannot be deleted if it is used as the source or destination of a rule in another security group.

    Delete or modify the rule and delete the security group again.

    For example, if the source of a rule in security group sg-B is set to sg-A, you need to delete or modify the rule in sg-B before deleting sg-A.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select the desired region and project.
  3. Click in the upper left corner and choose Networking > Virtual Private Cloud.

    The Virtual Private Cloud page is displayed.

  4. In the navigation pane on the left, choose Access Control > Security Groups.

    The security group list is displayed.

  5. Locate the row that contains the target security group, click More in the Operation column, and click Delete.

    A confirmation dialog box is displayed.

  6. Confirm the information and click OK.