All Products
Search
Document Center

Cloud Firewall:ModifyVpcFirewallSwitchStatus

Last Updated:Sep 18, 2026

Modifies the status of a virtual private cloud (VPC) firewall that protects traffic between two VPCs connected through an Express Connect circuit.

Operation description

This operation is used to modify the status of a virtual private cloud (VPC) firewall. The VPC firewall protects traffic between two VPCs connected through an Express Connect circuit. After you enable the VPC firewall, mutual access traffic between the two VPCs connected through the Express Connect circuit is protected by the VPC firewall. After you disable the VPC firewall, the VPC firewall no longer protects mutual access traffic between the two VPCs connected through the Express Connect circuit.

Before you invoke this operation, make sure that you have invoked the CreateVpcFirewallConfigure operation to create a VPC firewall.

QPS limit

The single-user QPS limit for this operation is 10 calls per second. If the number of calls per second exceeds the limit, throttling is triggered. This may affect your business. Manage your calls to this operation accordingly.

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

yundun-cloudfirewall:ModifyVpcFirewallSwitchStatus

update

*VpcFirewall

acs:cloudfirewall::{#accountId}:vpcfirewall/{#VpcFirewallId}

None None

Request parameters

Parameter

Type

Required

Description

Example

Lang

string

No

The language of the content within the request and response. Valid values:

  • zh (default): Chinese.

  • en: English.

zh

VpcFirewallId

string

Yes

The instance ID of the virtual private cloud (VPC) firewall.

Note

You can invoke the DescribeVpcFirewallList operation to query the instance ID of the VPC firewall.

vfw-m5e7dbc4y****

FirewallSwitch

string

Yes

The status of the virtual private cloud (VPC) firewall. Valid values:

  • open: Enable.

  • close: Disable.

open

MemberUid

string

No

The UID of the member account of the current Alibaba Cloud account.

258039427902****

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

850A84D6-0DE4-4797-A1E8-00090125afj2

Examples

Success response

JSON format

{
  "RequestId": "850A84D6-0DE4-4797-A1E8-00090125afj2"
}

Error codes

HTTP status code

Error code

Error message

Description

200 ErrorDBUpdateError A database update error occurred. A database update error occurred.
400 ErrorFirewallSwitch The firewall enabling parameter is incorrect. Please select again. The specified switch of the firewall is invalid. Enter another value.
400 ErrorDBTxError A database transaction error occurred. The error message returned because an internal error has occurred in the database transaction.
400 ErrorRecordLog An error occurred while updating the operation log. An error occurred while updating the operation log.
400 ErrorAliUid Aliuid invalid. The aliuid is invalid.
400 ErrorInvalidMemberUid Member uid is invalid The member is invalid.
400 ErrorFirewallId Firewall ID is invalid. The ID of the firewall is invalid.
400 ErrorVpcFirewallNotFound Vpc firewall not found. The specified VPC firewall does not exist. Select another one.
400 ErrorDBSelectError A database select error occurred. The error message returned because an internal error has occurred in querying the database.
400 ErrorNetworkInterfaceNotFound The NIC of the firewall is invalid. Check its configurations. The NIC of the firewall is invalid. Check the parameter.
400 ErrorFirewallCannotOpen The firewall status is invalid, can not open. The firewall cannot be enabled because the status of the firewall is invalid. Try again later.
400 ErrorVpcFirewall.CannotOpen VPC firewall '{vpc_firewall_id}' cannot be opened in current state '{current_state}'. Reason: {reason}. Please wait {retry_after_seconds} seconds and retry. VPC firewall '{vpc_firewall_id}' cannot be opened in current state '{current_state}'. Reason: {reason}. Please wait {retry_after_seconds} seconds and retry.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.