All Products
Search
Document Center

Web Application Firewall:ModifyCloudResource

Last Updated:Jul 31, 2026

Modifies the configuration of a cloud service that is connected to WAF.

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-waf:ModifyCloudResource

update

DefenseResource

acs:yundun-waf:{#regionId}:{#accountId}:defenseresource/{#Resource}

DefenseResource

acs:yundun-waf:{#regionId}:{#accountId}:defenseresource/{#ResourceInstanceId}-{#Port}-{#Product}

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The ID of the WAF instance.

Note

You can call DescribeInstance to query the ID of the current WAF instance.

waf_v3prepaid_public_cn-***

ResourceManagerResourceGroupId

string

No

The ID of the Alibaba Cloud resource group.

rg-acfm***q

Listen

object

Yes

The listening configuration.

TLSVersion

string

No

The TLS version to add. This parameter is used only when HttpsPorts is not empty, which indicates that the domain name uses the HTTPS protocol. Valid values:

  • tlsv1: Supports TLS 1.0 and later. Provides the highest compatibility and the lowest security.

  • tlsv1.1: Supports TLS 1.1 and later. Provides good compatibility and good security.

  • tlsv1.2: Supports TLS 1.2 and later. Provides good compatibility and the highest security.

  • tlsv1.3: Supports only TLS 1.3. Provides the highest security and the lowest compatibility.

tlsv1.2

EnableTLSv3

boolean

No

Specifies whether TLS 1.3 is supported. Valid values:

  • true: TLS 1.3 is supported.

  • false: TLS 1.3 is not supported.

Note

This parameter is used only when HttpsPorts is not empty, which indicates that the domain name uses the HTTPS protocol. When TLSVersion is set to tlsv1.3, this value must be true.

true

CipherSuite

integer

No

The type of cipher suite to add. This parameter is used only when HttpsPorts is not empty, which indicates that the domain name uses the HTTPS protocol. Valid values:

  • 1: all cipher suites.

  • 2: strong cipher suites. This value can be selected only when TLSVersion is set to tlsv1.2.

  • 99: custom cipher suites. This value can be selected only when TLSVersion is not set to tlsv1.3.

1

CustomCiphers

array

No

The custom cipher suites.

string

No

The specific custom cipher suite to add. This parameter is used only when CipherSuite is set to 99.

ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-GCM-SHA384

ResourceProduct deprecated

string

No

The cloud service type.

Valid values:

  • clb7 :

    Layer 7 CLB.

  • ecs :

    ECS.

  • clb4 :

    Layer 4 CLB.

  • nlb :

    NLB.

clb7

ResourceInstanceId deprecated

string

No

The instance ID of the resource.

lb-***

Port deprecated

integer

No

The port of the cloud service connected to WAF.

80

Protocol

string

Yes

The protocol type.

Valid values:

  • http :

    HTTP.

  • https :

    HTTPS.

http

Certificates

array<object>

No

The certificate information.

object

No

The certificate information.

CertificateId

string

No

The certificate ID.

123-cn-hangzhou

AppliedType

string

No

The certificate type for the HTTPS protocol. Valid values:

  • default: default certificate.

  • extension: extended certificate.

default

Http2Enabled

boolean

No

Specifies whether to enable HTTP/2. This parameter is used only when HttpsPorts is not empty, which indicates that the domain name uses the HTTPS protocol. Valid values:

  • true: HTTP/2 is enabled.

  • false (default): HTTP/2 is not enabled.

true

Redirect

object

No

The forwarding configuration.

RequestHeaders

array<object>

No

The traffic mark fields and values of the domain name, which are used to mark traffic processed by WAF.

object

No

The value of this parameter is in the format of [{"k":"key","v":"value"}]. key specifies the custom request header field, and value specifies the value set for the field.

Note

If the custom header field already exists in the request, the system overwrites the value of the custom field in the request with the specified traffic mark value.

Key

string

No

The specified custom request header field.

key1

Value

string

No

The value set for the custom request header field.

value1

XffHeaderMode

integer

No

The method that WAF uses to obtain the originating IP address of the client. Valid values:

  • 0: The client access traffic is not forwarded by any other Layer 7 proxy before reaching WAF.

  • 1: WAF reads the first value in the X-Forwarded-For (XFF) header as the client IP address.

  • 2: WAF reads the value of a custom header field that you specify as the client IP address.

0

XffHeaders

array

No

The list of custom fields used to obtain the client IP address, in the format of ["header1","header2",……].

Note

This parameter is required only when XffHeaderMode is set to 2, which indicates that WAF reads the value of a custom header field that you specify as the client IP address.

string

No

The list of custom fields used to obtain the client IP address, in the format of ["header1","header2",……].

Note

This parameter is required only when XffHeaderMode is set to 2, which indicates that WAF reads the value of a custom header field that you specify as the client IP address.

header1

ReadTimeout

integer

No

The read timeout period. Unit: seconds. Valid values: 1 to 3600.

1

WriteTimeout

integer

No

The write timeout period. Unit: seconds. Valid values: 1 to 3600.

1

Keepalive

boolean

No

Specifies whether to enable persistent connections. Valid values:

  • true (default): Persistent connections are enabled.

  • false: Persistent connections are not enabled.

true

KeepaliveRequests

integer

No

The number of requests that can reuse a persistent connection. Valid values: 60 to 1000.

Note

After persistent connections are enabled, this parameter specifies how many requests can reuse a persistent connection.

1000

KeepaliveTimeout

integer

No

The idle timeout period for persistent connections. Valid values: 10 to 3600. Default value: 3600. Unit: seconds.

Note

Specifies how long an idle persistent connection can remain open before it is released.

15

XffProto

boolean

No

Specifies whether to use X-Forward-For-Proto to pass the protocol used by WAF. Valid values:

  • true (default): The protocol used by WAF is passed.

  • false: The protocol used by WAF is not passed.

true

MaxBodySize

integer

No

The maximum request body size. Valid values: 2 to 10. Default value: 2. Unit: GB.

2

RegionId

string

Yes

The region where the WAF instance resides. Valid values:

  • cn-hangzhou: the Chinese mainland.

  • ap-southeast-1: outside the Chinese mainland.

cn-hangzhou

CloudResourceId

string

No

The ID of the connected resource, which is automatically generated by WAF during cloud native mode connection.

Note

You can call CreateCloudResource to connect a resource and then view the resource ID in the response.

lb-***-80-clb7

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

D7861F61-5B61-46CE-A47C-***

CloudResource

string

The connected resource ID.

lb-xxx-80-clb7

Examples

Success response

JSON format

{
  "RequestId": "D7861F61-5B61-46CE-A47C-***",
  "CloudResource": "lb-xxx-80-clb7"
}

Error codes

HTTP status code

Error code

Error message

Description

400 Waf.Pullin.CertExpired Certificate expired, certificate ID:%s . Certificate expired, certificate ID:%s.
400 Waf.Pullin.CertNotExist Certificate does not exist in SSL Certificate Center, certificate type:%s, certificate ID:%s. Certificate does not exist in SSL Certificate Center, certificate type:%s, certificate ID:%s.
400 Waf.Pullin.OnlyBeOneDefaultCert There can be only one default certificate. There can be only one default certificate.
400 Waf.Control.CloudProductInfoNotMartch The value of the cloud product, port, instance, and input parameter to which the resource ID of the cloud product is connected to WAF does not match. The value of the cloud product, port, instance, and input parameter to which the resource ID of the cloud product is connected to WAF does not match.
400 Waf.Control.CloudProductInfoEmpty The resource Id of the cloud product accessing WAF is null or null values exist in the three input parameters of the cloud product name, port, and cloud product instance. The resource Id of the cloud product accessing WAF is null or null values exist in the three input parameters of the cloud product name, port, and cloud product instance.
400 Waf.Control.DefenseResourceEmpty CloudResourceId parameter is illegal. CloudResourceId parameter is illegal

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.