Could not delete a security group
Written by
Updated at November 27, 2023
Issue description
You cannot delete the security group and see this error:
code = FailedPrecondition desc = Security group with id *** not empty
Solution
Before deleting a security group, detach it from the VM instance.
To do this:
- In the management console, go to Compute Cloud.
- Select the target VM instance.
- In the VM settings, scroll down to the network settings.
- Click on the ··· button and in the drop-down list, select Change network interface.
- Detach the security group.
- Click Save.