Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Intertech Services AG
Yandex Virtual Private Cloud
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Cloud network
    • Subnet
    • IP address
    • Static routing
    • Security groups
      • Create a security group
      • Changing the name and description
      • Adding a new rule
      • Delete a rule
      • Moving a security group between folders
      • Delete a security group
    • Enable a software-accelerated network
    • DDoS protection
    • Chart of network connections
  • Practical guidelines
  • Concepts
  • DDoS Protection
  • Recommendations
  • Access management
  • Pricing policy
  • API reference
  • Questions and answers
  1. Step-by-step instructions
  2. Security groups
  3. Moving a security group between folders

Moving a security group to a different folder

Written by
Yandex Cloud
  • Examples
    • Security group in the current folder
    • Security group in a different folder

This feature is in the Preview stage.

Management console
CLI
API

To move a security group to a different folder:

  1. In the management console, go to the folder where the security group is located.
  2. In the list of services, select Virtual Private Cloud.
  3. On the left-hand panel, select Security groups.
  4. Click in the row of the security group to be moved and select Move.
  5. Select the destination folder from the drop-down list.
  6. Click Move.

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.

To move a security group to a different folder:

  1. View a description of the CLI move security group command:

    yc vpc security-group move --help
    
  2. Get the name or ID of the security group to move:

    yc vpc security-group list
    

    Result:

    +----------------------+---------------------------------+------------------------------------+----------------------+
    |          ID          |              NAME               |          DESCRIPTION               |      NETWORK-ID      |
    +----------------------+---------------------------------+------------------------------------+----------------------+
    | enc2ta63h3q2jsri70ll | default-sg-enc39op1vq9m8tjr3udp | Default security group for network | enc39op1vq9m8tjr3udp |
    | enc612keceq8u2ioa2h6 | default-sg-encb4ubvmief09h6qg5e | Default security group for network | encb4ubvmief09h6qg5e |
    | encnn4l7b3lpm0095epd | default-sg-enc772aa2rgqiqq67ehu | Default security group for network | enc772aa2rgqiqq67ehu |
    | encemkpqg8fhu8em3uc0 | my-sg-1                         | Custom security group              | encb4ubvmief09h6qg5e |
    +----------------------+---------------------------------+------------------------------------+----------------------+
    
  3. Get a list of available folders:

    yc resource-manager folder list
    

    Result:

    +----------------------+------------------------+--------+--------+
    |          ID          |          NAME          | LABELS | STATUS |
    +----------------------+------------------------+--------+--------+
    | b1cs8ie21pk10aurd2c3 | default                |        | ACTIVE |
    | b1chgf288nvg541tgu73 | my-folder-1            |        | ACTIVE |
    | b1cu6g9ielh690at5bm7 | my-folder-2            |        | ACTIVE |
    +----------------------+------------------------+--------+--------+
    
  4. Move the security group by specifying the name or ID of the group and destination folder:

    yc vpc security-group move <group_name_or_ID> \
      --destination-folder-name <name_of_destination_folder> \
      --destination-folder-id <ID_of_destination_folder>
    

    Use either the --destination-folder-name parameter or the --destination-folder-id parameter.

    If the security group is not in the current folder (default folder), specify the source folder using the --folder-name or --folder-id option.

    Result:

    id: encemkpqg8fhu8em3uc0
    folder_id: b1chgf288nvg541tgu73
    created_at: "2022-10-10T13:24:59Z"
    name: my-sg-1
    network_id: encb4ubvmief09h6qg5e
    status: ACTIVE
    

    For more information about the yc vpc security-group move command, see the CLI reference.

To move a security group to a different folder, use the move REST API method for the SecurityGroup resource or the SecurityGroupService/Move gRPC API call.

Examples

Security group in the current folder

Move a security group from the current folder by specifying the group name and destination folder name:

CLI
yc vpc security-group move my-sg-1 \
  --destination-folder-name my-folder-1

Security group in a different folder

Move a security group from a different folder. Specify the group ID and the source and destination folder IDs:

CLI
yc vpc security-group move encemkpqg8fhu8em3uc0 \
  --folder-id b1chgf288nvg541tgu73 \
  --destination-folder-id b1cs8ie21pk10aurd2c3

See also

  • Moving a cloud network to a different folder

Was the article helpful?

Language / Region
Yandex project
© 2023 Intertech Services AG
In this article:
  • Examples
  • Security group in the current folder
  • Security group in a different folder