Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Virtual Private Cloud
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Cloud network
      • Creating a cloud network
      • Deleting a cloud network
      • Updating a cloud network
    • Subnet
      • Creating a subnet
      • Deleting a subnet
      • Updating a subnet
    • IP address
      • Reserving a static public IP address
      • Making a dynamic public IP address static
      • Making a static public IP address dynamic
      • Deleting a static public IP address
    • Static routes
      • Creating a static route
      • Enabling NAT to the internet
    • Security groups
      • Create a security group
      • Update a security group and rules
      • Delete a security group
    • DDoS Protection
      • Enable protection from DDoS attacks
  • Use cases
    • Architecture and protection of a basic internet service
  • Concepts
    • Relationship between service resources
    • Cloud networks and subnets
    • Cloud resource addresses
    • Static routes
    • Security groups
    • MTU and MSS
    • DHCP settings
    • Quotas and limits
  • DDoS Protection
  • Cloud Interconnect
  • Access management
  • Pricing policy
    • Current policy
    • Archive
      • Policy before January 1, 2019
  • API reference
    • Authentication in the API
    • gRPC
      • Overview
      • AddressService
      • NetworkService
      • RouteTableService
      • SecurityGroupService
      • SubnetService
      • OperationService
    • REST
      • Overview
      • Address
        • Overview
        • create
        • delete
        • get
        • getByValue
        • list
        • listOperations
        • update
      • Network
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • listSubnets
        • move
        • update
      • RouteTable
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • SecurityGroup
        • Overview
      • Subnet
        • Overview
        • create
        • delete
        • get
        • list
        • listOperations
        • move
        • update
      • Operation
        • Overview
        • get
  • Questions and answers
  1. Step-by-step instructions
  2. Security groups
  3. Delete a security group

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:

    Management console
    CLI
    Terraform
    1. Open the Virtual Private Cloud section in the folder to delete the security group from.
    2. Open the Security groups tab.
    3. Click in the row of the group you want to delete.
    4. In the menu that opens, click Delete.
    5. 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.

    1. See the description of the CLI command for deleting security groups:

      $ yc vpc security-group delete --help
      
    2. 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 |
      +----------------------+-------------+-------------+----------------------+
      
    3. Select the ID or NAME of the network you need.

    4. 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:

    1. In the command line, go to the directory with the Terraform configuration file.

    2. 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.

    3. Confirm the deletion of resources.

    Language
    Careers
    Privacy policy
    Terms of use
    © 2021 Yandex.Cloud LLC