You can export security group rules to JSON or CSV files for local backup.

Procedure

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Network & Security > Security Groups.
  3. In the top navigation bar, select a region.
  4. On the Security Groups page, find the security group for which you want to export security group rules and click Add Rules in the Actions column.
  5. Click Export Rules and select JSON Format or CSV Format to download and save the rules to a local file.
    • JSON Format

      A JSON file must adhere to the following naming conventions: ecs_${region_id}_${groupID}.json.

      If regionID is set to cn-qingdao and groupID is set to sg-123, the name of exported JSON file is ecs_cn-qingdao_sg-123.json.

    • CSV Format

      A CSV file must adhere to the following naming conventions: ecs_sgRule_${groupID}_${region_id}_${time}.csv.

      If regionID is set to cn-qingdao, groupID is set to sg-123, and time is set to 2020-01-20, the name of the exported CSV file is ecs_sgRule_sg-123_cn-qingdao_2020-01-20.csv.