All Products
Search
Document Center

Virtual Private Cloud:ModifyVpcPrefixList

Last Updated:Jul 16, 2026

Modifies the configuration of a prefix list.

Operation description

  • ModifyVpcPrefixList is an asynchronous operation. After a request is sent, the system returns a request ID. However, the configuration of the prefix list instance is not immediately modified because the modification node is still running in the background. You can invoke ListPrefixLists to query the status of the prefix list instance.

    • If the prefix list instance is in the Modifying state, the configuration of the prefix list instance is being modified.

    • If the prefix list instance is in the Created state, the configuration of the prefix list instance is modified.

    • After the configuration of the prefix list instance is modified, you can invoke GetVpcPrefixListAssociations to query the associations of the prefix list to check whether the associated resources use the modified Classless Inter-Domain Routing (CIDR) blocks. If the Status parameter of the prefix list association is Created, the associated resources use the modified CIDR blocks.

  • ModifyVpcPrefixList does not support concurrent modifications to the same prefix list.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:ModifyVpcPrefixList

update

*PrefixList

acs:vpc:{#regionId}:{#accountId}:prefixlist/{#PrefixListId}

None None

Request parameters

Parameter

Type

Required

Description

Example

PrefixListId

string

Yes

The instance ID of the prefix list that you want to modify.

pl-0b7hwu67****

PrefixListName

string

No

The new name of the prefix list.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

newname

ClientToken

string

No

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId may differ for each API request.

123e4567-e89b-12d3-a456-426655440000

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run. The system checks the required parameters, request syntax, and business restrictions. If the check fails, the corresponding error is returned. If the check succeeds, the DryRunOperation error code is returned.

  • false (default): performs a dry run and sends the request. After the request passes the dry run, the configuration of the prefix list is modified and an HTTP 2xx status code is returned.

false

AddPrefixListEntry

array<object>

No

The list of Classless Inter-Domain Routing (CIDR) blocks to be added to the prefix list instance.

object

No

The Classless Inter-Domain Routing (CIDR) block to be added to the prefix list instance.

Cidr

string

No

The Classless Inter-Domain Routing (CIDR) block to be added to the prefix list instance.

Note

If the CIDR block already exists in the prefix list, only the value of AddPrefixListEntry.N.Description is modified, which means only the description of the CIDR block is modified.

172.16.0.0/12

Description

string

No

The description of the Classless Inter-Domain Routing (CIDR) block to be added to the prefix list instance.

The description must be 1 to 128 characters in length and cannot start with http:// or https://.

newcidr

RemovePrefixListEntry

array<object>

No

The list of Classless Inter-Domain Routing (CIDR) blocks to be deleted from the prefix list instance.

object

No

The list of Classless Inter-Domain Routing (CIDR) blocks to be deleted from the prefix list instance.

Cidr

string

No

The Classless Inter-Domain Routing (CIDR) block to be deleted from the prefix list instance.

192.168.0.0/16

Description

string

No

The description of the Classless Inter-Domain Routing (CIDR) block to be deleted from the prefix list.

cidr

RegionId

string

Yes

The region ID of the prefix list that you want to modify.

cn-hangzhou

PrefixListDescription

string

No

The new description of the prefix list.

The description must be 1 to 256 characters in length and cannot start with http:// or https://.

newdescription

MaxEntries

integer

No

The new maximum number of Classless Inter-Domain Routing (CIDR) block entries in the prefix list instance.

20

Response elements

Element

Type

Description

Example

object

PrefixListId

string

The instance ID of the prefix list.

pl-0b7hwu67****

RequestId

string

The request ID.

54B48E3D-DF70-471B-AA93-08E683A1B45

Examples

Success response

JSON format

{
  "PrefixListId": "pl-0b7hwu67****",
  "RequestId": "54B48E3D-DF70-471B-AA93-08E683A1B45"
}

Error codes

HTTP status code

Error code

Error message

Description

400 ResourceNotFound.PrefixList The specified resource of prefixList is not found. The prefix list does not exist.
400 OperationFailed.CidrCountExceedMaxCount The operation is failed because of cidrCountExceedMaxCount. The number of CIDR blocks specified exceeds the maximum allowed value of cidrMaxCount.
400 OperationDenied.RemoveCountExceedExistCount The operation is not allowed because of remove-count exceed exist-count. The number of CIDR blocks to delete exceeds the number owned by the prefix list.
400 DuplicatedParam.CidrBlock The param of cidrBlock is duplicated. The error message returned because a duplicate CIDR block is specified.
400 IllegalParam.CidrBlock The param of cidrBlock is illegal. The error message returned because the value of the cidrBlock parameter is invalid.
400 IllegalParam.CidrName The param of cidrName is illegal. The specified cidrName is invalid.
400 OperationDenied.SystemPrefixList This is not allowed to operate system prefixList.
400 OperationFailed.OperateShareResource This is not allowed to operate shared prefixList. You cannot operate on a shared prefix list.
400 IncorrectStatus.PrefixList The status of prefixList is incorrect. The prefix list is in an unstable state.
400 QuotaExceeded.PrefixListCidrCount The quota of prefixList entry maxEntry count is exceeded. The number of allowed routes exceeds the upper limit.
400 QuotaExceeded Route entry quota exceeded in associated route table. The maximum number of routes supported by the prefix list exceeds the maximum number of routes supported by the associated route table.
400 OperationDenied.QuotaExceededWithNetworkAcl If the prefix list increases MaxEntries, the quota for the maximum number of entries for the associated network ACL instance %s is exceeded. If the prefix list increases the maximum number of entries, the quota for the maximum number of entries for the associated network ACL instance is exceeded.
400 ServiceUnavailable The request has failed due to a temporary failure of the server. The request failed due to a temporary server error.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.