Delete a security group
The feature is at the Preview stage.
Warning
You can't delete security group created by default in the network.
To delete a security group:
- Open the Virtual Private Cloud section in the folder to delete the security group from.
- Open the Security groups tab.
- Click in the row of the group you want to delete.
- In the menu that opens, click Delete.
- In the window that opens, click Delete.
If you don't have the Yandex.Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for deleting security groups:
$ yc vpc security-group delete --help
-
Get a list of all security groups in the default folder:
$ yc vpc security-group list +----------------------+-------------+-------------+----------------------+ | ID | NAME | DESCRIPTION | NETWORK-ID | +----------------------+-------------+-------------+----------------------+ | enpkf7dbjonf45gda6cd | test-sg-cli | | enpgkbe17td89r34satu | +----------------------+-------------+-------------+----------------------+
-
Select the
ID
orNAME
of the network you need. -
Delete the network:
$ yc vpc security-group delete test-sg-cli
With Terraform, you can quickly create a cloud infrastructure in Yandex.Cloud. The infrastructure components are identified through configuration files that specify the required cloud resources and their parameters.
Read more about Terraform in the documentation.
If you created a security group using Terraform, you can delete it:
-
In the command line, go to the directory with the Terraform configuration file.
-
Delete resources using the command:
$ terraform destroy
Alert
Terraform deletes all the resources that you created in the current configuration, such as clusters, networks, subnets, and VMs.
-
Confirm the deletion of resources.