Updated on 2026-11-04 GMT+08:00

Cloning a Security Group

Scenarios

VPC allows you to clone a security group within a region or across regions, so that you can quickly apply the same security group rules to ECSs in different regions.

You can clone a security group in the following scenarios:

  • For example, you have security group sg-A in region A. If ECSs in region B require the same security group rules as those configured for security group sg-A, you can clone security group sg-A to region B, freeing you from creating a new security group in region B.
  • If you need new security group rules, you can clone the original security group as a backup.
  • Before you modify security group rules used by a service, you can clone the security group and modify the security group rules in the test environment to ensure that the modified rules work.

Constraints

  • You can clone a security group from the same or a different region.
    • If you want to clone a security group from the same region, you can clone all rules in the security group.
    • If you want to clone a security group from a different region, the system will clone only rules with source or destination set to IP addresses or the current security group. Rules with source or destination set to an IP address group or another security group will not be cloned.
  • Only the security group and its rules are cloned, but not the instances associated with the security group. After the clone is complete, you need to add the instances to the new security group. For details, see Adding an Instance to or Removing an Instance from a Security Group.
  • Cloned security groups can only be used in the same account. To quickly create a security group across accounts, you can import or export security group rules by referring to Importing and Exporting Security Group Rules.

Procedure

  1. Go to the security group list page.
  2. Locate the row that contains the security group, click More in the Operation column, and click Clone.
  3. Configure parameters such as the region and name of the new security group as prompted.
  4. Click OK.

    You can view the cloned security group in the security group list of the corresponding region.