All Products
Search
Document Center

Virtual Private Cloud:PublishVpcRouteEntries

Last Updated:Jul 10, 2026

Publishes VPC routes to external components.

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:PublishVpcRouteEntries

update

*RouteTable

acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the instance. You can call the DescribeRegions operation to query the region ID.

cn-hangzhou

RegionId

string

No

The list of route entries to publish. A maximum of 50 routes can be specified.

cn-hangzhou

RouteEntries

array<object>

No

The type of the route publish target.

object

No

List of route entry information to be published.

RouteTableId

string

Yes

The ID of the route table for the route entry.

vtb-2ze3jgygk9bmsj23s****

DestinationCidrBlock

string

Yes

The destination CIDR block for the route entry.

121.41.165.123/32

TargetType

string

Yes

The publish route entry target instance ID.

ECR

TargetInstanceId

string

Yes

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run without publishing route entries. The system checks the AccessKey pair, Resource Access Management (RAM) user authorization, and required parameters. If the check fails, the corresponding error is returned. If the check passes, the error code DryRunOperation is returned.

  • false (default): sends a Normal request. After the request passes the check, a 2xx HTTP status code is returned and the resource status is queried.

ecr-dhw2xsds5****

DryRun

boolean

No

Indicates whether to perform a dry run of this request. Values:

  • true: Sends a check request without publishing the route. The checks include whether the AccessKey is valid, the authorization status of the RAM user, and if all required parameters are filled out. If the check fails, the corresponding error is returned. If the check passes, the DryRunOperation error code is returned.

  • false (default): Sends a normal request. After passing the check, it returns a 2xx HTTP status code and directly queries the resource status.

false

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

980960B0-2969-40BF-8542-EBB34FD358AB

Examples

Success response

JSON format

{
  "RequestId": "980960B0-2969-40BF-8542-EBB34FD358AB"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IncorrectStatus.Vpc The status of %s [%s] is incorrect. The instance is in an invalid state.
400 ResourceNotFound.RouteEntry The specified resource routeEntry is not found. The specified route entry does not exist
400 IncorrectStatus.RouteEntry The status of %s [%s] is incorrect. Route entry is in non-steady state
400 Forbidden.OperateCustomRouteTable The operation is forbidden because publish route entry in custom route table. The operation is prohibited because it is not allowed to publish route entries in the custom route table.
400 IncorrectStatus.RouteEntryPublishStatus Route entry publish status is incorrect. The route publish status of the route entry is incorrect.
400 ResourceNotAssociated.TargetInstance The target instance is not associated with vpc.
400 OperationDenied.UnsupportedTargetType The operation is not allowed because the target type is not supported. The operation was rejected because the type of the route publication target is not currently supported.
400 IncorrectStatus.RouteTable The route table is in an invalid state. The specified routing table is in the wrong state
400 OperationUnsupported.PublishSystemRouteEntry Publishing system route entry is unsupported. Publishing system routes is not supported.
400 OperationUnsupported.UnsupportedNextHop Unsupported nexthop type for route entry publish operation. The next hop type of the route entry does not support publishing.
400 OperationUnsupported.PublishPrefixListRouteEntry Publishing prefix list route entry is unsupported. Publishing route prefix list routes is not supported.
400 InvalidRouteTableId.NotFound Specified route table does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.