Connects a cloud service to WAF in cloud native mode. Supported cloud services include ECS, CLB, NLB, and Anti-DDoS.
Operation description
Before invoking this operation, complete the following steps:
Confirm that you have a WAF instance. Invoke DescribeInstance to query the ID of your WAF instance.
Confirm that the cloud service to be connected meets the applicable scope. For ECS, CLB, and NLB connections, verify the instance specifications and region. Refer to the "Applicable Scope" section in the ECS connection, CLB connection, and NLB connection documentation. For Anti-DDoS connections, which are configured for domain names, refer to the "Applicable Scope" section in the Anti-DDoS connection documentation. After completing the preceding steps, invoke this operation to connect the cloud service to WAF in cloud native mode.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-waf:CreateCloudResource |
create |
*DefenseResource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the WAF instance. Note
Call DescribeInstance to query the ID of your WAF instance. |
waf_v3prepaid_public_cn-*** |
| ResourceManagerResourceGroupId |
string |
No |
The ID of the Alibaba Cloud resource group. |
rg-acfm***q |
| Listen |
object |
Yes |
The listener 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 HTTPS. Valid values:
|
tlsv1 |
| EnableTLSv3 |
boolean |
No |
Specifies whether TLS 1.3 is supported. Valid values:
Note
This parameter is used only when HttpsPorts is not empty, which indicates that the domain name uses HTTPS. 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 HTTPS. Valid values:
|
1 |
| CustomCiphers |
array |
No |
The specific custom cipher suites to add. This parameter is used only when CipherSuite is set to 99. |
|
|
string |
No |
The specific custom cipher suites to add. This parameter is used only when CipherSuite is set to 99. |
ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384 |
|
| ResourceProduct |
string |
Yes |
The cloud service type. Valid values:
|
clb4 |
| Port |
integer |
No |
The port of the cloud service connected to WAF. |
80 |
| ResourceInstanceId |
string |
No |
The ID of the cloud service instance. Note
The instance must meet the applicable scope of the corresponding cloud service (instance specifications, region, etc.). Refer to the corresponding product connection documentation listed in the operation description. This parameter is required when ResourceProduct is set to ecs, clb4, clb7, or nlb. |
lb-bp1***** |
| Protocol |
string |
No |
The protocol type. Valid values:
|
http |
| Certificates |
array<object> |
No |
The list of certificate IDs. |
|
|
object |
No |
The certificate information. |
||
| CertificateId |
string |
No |
The ID of the certificate to add. Note
Call DescribeResourceInstanceCerts to query the IDs of all SSL certificates associated with the cloud service instance. |
123-cn-hangzhou |
| AppliedType |
string |
No |
The certificate type for the HTTPS protocol. Valid values:
|
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 HTTPS. Valid values:
|
true |
| ResourceRegionId |
string |
No |
The region ID of the cloud service. Note
This parameter is required when the instance ID to be connected has not been synchronized to WAF. Call SyncProductInstance to synchronize ECS, CLB, and NLB assets, and call DescribeProductInstances to query the synchronized cloud service assets and their region IDs. |
cn-hangzhou |
| Domain |
string |
No |
The domain name to connect to WAF. Note
This parameter is required only when the cloud service type is ddos. For other service types, leave this field empty. Refer to the Anti-DDoS connection documentation listed in the operation description for the applicable scope of domain names. |
www.c**sw.net |
| Redirect |
object |
No |
The forwarding configuration. |
|
| RequestHeaders |
array<object> |
No |
The value of this parameter is in the format of [{"k":"key","v":"value"}], where 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. |
|
|
object |
No |
The value of this parameter is in the format of [{"k":"key","v":"value"}], where key specifies the custom request header field and value specifies the value set for the field. |
||
| Key |
string |
No |
The 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:
|
1 |
| XffHeaders |
array |
No |
The list of custom header 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 header 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 |
| 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 remains open before it is released. |
3600 |
| XffProto |
boolean |
No |
Specifies whether to use X-Forward-For-Proto to pass the protocol used by WAF. Valid values:
|
true |
| MaxBodySize |
integer |
No |
The maximum request body size. Valid values: 2 to 10. Default value: 2. Unit: GB. Note
Only the Ultimate Edition supports this parameter. |
2 |
| Tag |
array<object> |
No |
The list of tags. A maximum of 20 tags can be specified. |
|
|
object |
No |
|||
| Key |
string |
No |
The tag key. |
TagKey1 |
| Value |
string |
No |
The tag value. |
TagValue1 |
| RegionId |
string |
Yes |
The region where the WAF instance resides. Valid values:
|
cn-hangzhou |
| OwnerUserId |
string |
No |
The UID of the current resource ownership. |
123 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
66A98669-ER12-WE34-23PO-301469*****E |
| CloudResourceId |
string |
The ID of the connected resource, automatically generated by WAF. |
lb-*** |
Examples
Success response
JSON format
{
"RequestId": "66A98669-ER12-WE34-23PO-301469*****E",
"CloudResourceId": "lb-***"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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.CertExpired | Certificate expired, certificate ID:%s . | Certificate expired, certificate ID:%s. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.