All Products
Search
Document Center

VPN Gateway:ModifyCustomerGatewayAttribute

Last Updated:Jun 19, 2026

Modifies the configuration of a customer gateway by calling the ModifyCustomerGatewayAttribute operation.

Operation description

  • When you call the ModifyCustomerGatewayAttribute operation, if the AuthKey parameter is not empty, this operation is asynchronous. The system returns the customer gateway information first, but the configuration has not been modified yet because the modification task is still running in the background. You can call DescribeVpnGateway to query the modification status of the customer gateway configuration:

    • If the VPN gateway instance is in the updating state, the customer gateway configuration is being modified.

    • If the VPN gateway instance is in the active state, the customer gateway configuration has been modified.

  • When you call the ModifyCustomerGatewayAttribute operation, if the AuthKey parameter is empty, this operation is synchronous.

  • The ModifyCustomerGatewayAttribute operation does not support concurrent modifications to the configuration of the same customer gateway.

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

update

*CustomerGateway

acs:vpc:{#regionId}:{#accountId}:customergateway/{#CustomerGatewayId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the customer gateway.

You can call the DescribeRegions operation to query region IDs.

cn-shanghai

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 ClientToken value 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.

02fb3da4-130e-11e9-8e44****

CustomerGatewayId

string

Yes

The instance ID of the customer gateway.

cgw-bp1pvpl9r9adju6l5****

Name

string

No

The name of the customer gateway.

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

nametest

Description

string

No

The description of the customer gateway.

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

desctest

AuthKey

string

No

The authentication key of the BGP route routing protocol for the on-premises data center gateway device.

The key must be 1 to 64 characters in length and can contain only ASCII characters. It cannot contain spaces, Chinese characters, or half-width question marks (?).

AuthKey****

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

8AA5CE21-2E6A-4530-BDF5-F055849476E6

IpAddress

string

The public IP address of the on-premises data center gateway device.

139.32.XX.XX

Description

string

The description of the customer gateway.

desctest

CustomerGatewayId

string

The instance ID of the customer gateway.

cgw-bp1pvpl9r9adju6l5****

CreateTime

integer

The timestamp when the customer gateway was created.

1492747187000

Name

string

The name of the customer gateway.

nametest

ResourceGroupId

string

The ID of the resource group to which the customer gateway belongs.

You can call the ListResourceGroups operation to query resource group information.

rg-acfmzs372yg****

Examples

Success response

JSON format

{
  "RequestId": "8AA5CE21-2E6A-4530-BDF5-F055849476E6",
  "IpAddress": "139.32.XX.XX",
  "Description": "desctest",
  "CustomerGatewayId": "cgw-bp1pvpl9r9adju6l5****",
  "CreateTime": 1492747187000,
  "Name": "nametest",
  "ResourceGroupId": "rg-acfmzs372yg****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidName The name is not valid
400 InvalidDescription The description is not valid
400 OperationDenied.MissingAsn The autonomous system number of the customer gateway is mandatory when BGP authentication key is specified. The autonomous system number of the customer gateway is mandatory when BGP authentication key is specified.
400 InvalidAuthkey.Malformed The specified BGP authentication key (%s) is malformed. The BGP authentication key is invalid.
400 OperationDenied.VpnFinancialLocked The associated VPN gateway is financially locked. You cannot update the attributes of the customer gateway. The associated VPN gateway is financially locked. You cannot update the attributes of the customer gateway.
400 OperationDenied.VpnConfiguring The associated VPN gateway is being configured. You cannot update the attributes of the customer gateway. The associated VPN gateway is being configured. You cannot update the attributes of the customer gateway.
403 Forbbiden.SubUser User not authorized to operate on the specified resource as your account is created by another user.
403 Forbidden User not authorized to operate on the specified resource. You do not have the permissions to manage the specified resource. Apply for the permissions and try again.
404 InvalidCustomerGatewayInstanceId.NotFound The specified customer gateway instance id does not exist. The specified customer gateway does not exist. Check whether the ID of the customer gateway is correct.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.