All Products
Search
Document Center

Web Application Firewall:CreateCloudResource

Last Updated:Mar 10, 2025

Adds a service to Web Application Firewall (WAF). This operation is supported for only the Elastic Compute Service (ECS) and Classic Load Balancer (CLB) services.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
yundun-waf:CreateCloudResourcecreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the WAF instance.

Note You can call the DescribeInstance operation to query the ID of the WAF instance.
waf_v3prepaid_public_cn-***
ResourceManagerResourceGroupIdstringNo

The ID of the Alibaba Cloud resource group.

rg-acfm***q
ListenobjectYes

The listener configurations.

TLSVersionstringNo

The Transport Layer Security (TLS) version that you want to add. This parameter is available only if you specify HttpsPorts. Valid values:

  • tlsv1
  • tlsv1.1
  • tlsv1.2
tlsv1
EnableTLSv3booleanNo

Specifies whether to support TLS 1.3. This parameter is available only if you specify HttpsPorts. Valid values:

  • true
  • false
true
CipherSuiteintegerNo

The type of the cipher suites that you want to add. This parameter is available only if you specify HttpsPorts. Valid values:

  • 1: all cipher suites.
  • 2: strong cipher suites. This value is available only if you set TLSVersion to tlsv1.2.
  • 99: custom cipher suites.
1
CustomCiphersarrayNo

The custom cipher suites that you want to add. This parameter is available only if you set CipherSuite to 99.

stringNo

The custom cipher suite that you want to add. This parameter is available only if you set CipherSuite to 99.

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

The type of the cloud service that you want to add. Valid values:

  • clb4: Layer 4 CLB.
  • clb7: Layer 7 CLB.
  • ecs: ECS.
  • nlb: Network Load Balancer (NLB).
clb4
ResourceInstanceIdstringYes

The instance ID of the cloud service.

lb-bp1*****
PortintegerYes

The port of the cloud service.

80
ProtocolstringYes

The protocol type. Valid values:

  • http
  • https
http
Certificatesarray<object>No

The certificates.

objectNo

The certificate.

CertificateIdstringNo

The ID of the certificate that you want to add.

Note You can call the DescribeCertificates operation to query the IDs of all SSL certificates that are associated with a domain name.
123-cn-hangzhou
AppliedTypestringNo

The type of the certificate. Valid values:

  • default: default certificate.
  • extension: additional certificate.
default
Http2EnabledbooleanNo

Specifies whether to enable HTTP/2. This parameter is available only if you specify HttpsPorts. Valid values:

  • true
  • false (default)
true
RedirectobjectNo

The forwarding configurations.

RequestHeadersarray<object>No

The custom header fields. Specify the value in the [{"k":"key","v":"value"}] format. key specifies the key of a custom header field. value specifies the value of a custom header field.

Note If a request contains a custom header field, WAF overwrites the original value of the field with the specified value.
objectNo

The custom header field. Specify the value in the [{"k":"key","v":"value"}] format. key specifies the key of a custom header field. value specifies the value of a custom header field.

KeystringNo

The key of the custom header field.

key1
ValuestringNo

The value of the custom header field.

value1
XffHeaderModeintegerNo

The method that is used to obtain the originating IP address of a client. Valid values:

  • 0: No Layer 7 proxies are deployed in front of WAF.
  • 1: WAF reads the first value of the X-Forwarded-For (XFF) header field as the originating IP address of the client.
  • 2: WAF reads the value of a custom header field as the originating IP address of the client.
1
XffHeadersarrayNo

The custom header fields that are used to obtain the originating IP address of a client. Specify the value in the ["header1","header2",...] format.

Note This parameter is required only if you set XffHeaderMode to 2.
stringNo

The custom header field that is used to obtain the originating IP address of a client. Specify the value in the ["header1","header2",...] format.

Note This parameter is required only if you set XffHeaderMode to 2.
header1
ReadTimeoutintegerNo

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

1
WriteTimeoutintegerNo

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

1
KeepalivebooleanNo

Specifies whether to enable the persistent connection feature. Valid values:

  • true (default)
  • false
true
KeepaliveRequestsintegerNo

The number of reused persistent connections. Valid values: 60 to 1000.

Note This parameter specifies the number of persistent connections that can be reused after you enable the persistent connection feature.
1000
KeepaliveTimeoutintegerNo

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

Note This parameter specifies the period of time after which an idle persistent connection is closed.
15
XffProtobooleanNo

Specifies whether to use the X-Forward-For-Proto header field to pass the protocol used by WAF to forward requests to the origin server. Valid values:

  • true (default)
  • false
true
Tagarray<object>No

The tags. You can specify up to 20 tags.

objectNo
KeystringNo

The key of the tag.

TagKey1
ValuestringNo

The value of the tag.

TagValue1
RegionIdstringYes

The region in which the WAF instance is deployed. Valid values:

  • cn-hangzhou: the Chinese mainland.
  • ap-southeast-1: outside the Chinese mainland.
cn-hangzhou
OwnerUserIdstringNo

The ID of the Alibaba Cloud account to which the resource belongs.

123

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

66A98669-ER12-WE34-23PO-301469*****E
CloudResourceIdstring

The ID of the resource that is added to WAF. The ID is automatically generated.

lb-***

Examples

Sample success responses

JSONformat

{
  "RequestId": "66A98669-ER12-WE34-23PO-301469*****E",
  "CloudResourceId": "lb-***"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-12-12The request parameters of the API has changedView Change Details
2024-10-10The internal configuration of the API is changed, but the call is not affectedView Change Details