A port list is a collection of ports. You can reference a port list when configuring network rules for other resources to avoid creating multiple separate rules for different ports, improving O&M efficiency. This topic describes how to create and configure a port list using the ECS console.
Create a port list
Use the ECS console
Go to the ECS console - Port List page.
In the upper-left corner of the page, select a region and resource group.
-
In the Port Lists section, click Create Port List.
-
In the Create Port List dialog box, configure the following parameters.
Parameter
Description
Port list name
Enter a name.
Description
Enter a description. Include usage details if possible.
Maximum entries
Set the maximum number of entries. This value cannot be changed after creation. For example, port ranges 22/22 and 3389/3389 use two entries.
Valid values: 1 to 2000
NoteWhen calculating rule quotas for associated resources (such as security groups), the system uses the maximum entries value, not the actual number of entries. Set this value carefully.
Port list entries
Click Add Entry to add a port range and description.
The port range in each entry matches the destination port of traffic. Specify a port range using a forward slash (/), such as 8000/9000 or 22/22.
Tags
Attach tag keys and tag values to the port list.
-
Click OK.
After creation, view the new port list on the list page. You can reference it in security group rules. For more information, see Add security group rules.
Use an API
-
Call CreatePortRangeList to create a port list.
-
After creation, use DescribePortRangeLists to view port list details. Then, use AuthorizeSecurityGroup or AuthorizeSecurityGroupEgress to reference your port list by setting PortRangeListId in inbound or outbound security group rules.
Clone a port list
When your business changes—such as during cross-region migration—you can quickly copy an existing port list to a new region by cloning it.
Go to the ECS console - Port List page.
In the upper-left corner of the page, select a region and resource group.
-
In the Port Lists section, find your target port list. In the Actions column, click Clone.
-
In the Clone dialog box, configure the following parameters.
Parameter
Description
Region
Select the region for the cloned port list. For example, China (Qingdao).
Port list name
Enter a name for the cloned port list.
Description
Enter a description for the cloned port list. Include usage details if possible.
Maximum entries
Set the maximum number of entries for the cloned port list. This value cannot be changed after creation.
Valid values: 1 to 2000
NoteWhen calculating rule quotas for associated resources (such as security groups), the system uses the maximum entries value, not the actual number of entries. Set this value carefully.
Port list entries
Configure port information. Click Add Entry to add a port range and description.
-
Copy Tags to Clone Port List: Select this option to clone the original port list’s tags to the new one.
-
Click OK.
After cloning, switch to the target region to view the cloned port list.
Manage port list entries
When your business requires port configuration changes—such as adding or modifying service ports—you can directly edit port list entries to quickly add, modify, or delete them. Changes take effect automatically in all associated security group rules.
Use the ECS console
Go to the ECS console - Port List page.
In the upper-left corner of the page, select a region and resource group.
-
In the Port Lists section, find your target port list and click its ID.
-
On the Port List Entries page, manage entries as follows.
-
Add a port list entry
-
Click Add Entry.
-
In the entry fields, enter a port range and description, then click Save.
To add multiple entries, repeat these steps.
-
-
Modify a port list entry
-
On the port list details page, find your target entry and click Modify.
-
Update the port range and description, then click Save.
-
-
Delete a port list entry
-
Delete a single entry: In the Actions column of the target entry, click Delete.
-
Delete multiple entries: Select the target entries and click Delete at the bottom of the page.
-
-
Use an API
Call ModifyPortRangeList to manage port list entries and update the name or description of a specified port list.
View resources associated with a port list
You can view resources already associated with a port list. Currently, port lists are used only in security group rules.
Use the ECS console
Go to the ECS console - Port List page.
In the upper-left corner of the page, select a region and resource group.
-
In the Port Lists section, find your target port list and click its ID.
-
On the Associated Resources page, view the resource IDs and resource types linked to this port list.
Use an API
Call DescribePortRangeListAssociations to query resources associated with a port list.
Delete a port list
Delete unused port lists that have no associated resources.
You cannot delete a port list if it has associated resources. First, remove all references to the port list from those resources.
Use the ECS console
Go to the ECS console - Port List page.
In the upper-left corner of the page, select a region and resource group.
-
In the Port Lists section, find and delete your target port list.
-
Delete a single port list
In the Actions column of the target port list, click Delete. In the confirmation dialog box, review the information and click OK.
-
Batch Delete Port List
Select the target port lists and click Batch Delete at the bottom of the page. In the confirmation dialog box, review the information, click Next, then click OK.
-
Use an API
Call DeletePortRangeList to delete a port list and all its entries.
References
For scenarios where port lists are useful, see Use prefix lists and port lists to efficiently manage security group rules.