Creates a protected object.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-waf:CreateDefenseResource |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Resource |
string |
No |
The name of the protected object. Note
|
abctest.com |
| Product |
string |
Yes |
The name of the Alibaba Cloud service. Valid values:
|
ecs |
| ResourceGroup |
string |
No |
The name of the protection group to which the protected object is added. |
testGroup |
| ResourceOrigin |
string |
Yes |
The origin type of the protected object. Valid values:
|
custom |
| Pattern |
string |
Yes |
The type of the protected object. Valid values:
|
domain |
| Detail |
string |
Yes |
The configuration details of the protected object, in JSON format. Note
The required parameters vary based on the values of Product and Pattern. For more information, see the Description of the Detail parameter section. |
{\"domain\": \"zhhclb4test096-05111.test.com\"} |
| XffStatus |
integer |
No |
Indicates whether the X-Forwarded-For (XFF) proxy feature is enabled. Valid values:
|
0 |
| CustomHeaders |
array |
No |
The custom header fields used to obtain the actual client IP address when XFF proxy is enabled. Note
If XffStatus is set to 1, WAF uses the first IP address from the specified header field as the client IP address to prevent XFF forgery. If you specify multiple header fields, WAF reads them in order. If no valid client IP address is found in the specified header fields, WAF falls back to the first IP address in the X-Forwarded-For header field. |
|
|
string |
No |
The name of a custom header field from which WAF extracts the client IP address. |
x-forwarded-for |
|
| Description |
string |
No |
The description of the protected object. |
test |
| InstanceId |
string |
Yes |
The ID of the WAF instance. Note
Call DescribeInstance to query the ID of the WAF instance. |
waf_v3prepaid_public_cn-4xl******* |
| OwnerUserId |
string |
No |
The ID of the Alibaba Cloud account to which the protected object belongs. This parameter is required only in multi-account scenarios. By default, the protected object belongs to the WAF administrator account. |
123221XXX |
| Tag |
array<object> |
No |
A list of tags. You can add up to 20 tags. |
|
|
object |
No |
The tag object. |
||
| Key |
string |
No |
The key of the tag. |
demoTagKey |
| Value |
string |
No |
The value of the tag. |
TagValue1 |
| ResourceManagerResourceGroupId |
string |
No |
The ID of the Alibaba Cloud resource group. |
rg-acfm***q |
| RegionId |
string |
No |
The region where the WAF instance resides. Valid values:
|
cn-hangzhou |
Description of the Detail parameter
ALB domain name (Product is set to alb and Pattern is set to domain)
Adds a protected object for the domain name of an Application Load Balancer (ALB) instance protected by WAF.
Parameters
| Name | Type | Required | Example | Description |
| instanceId | String | Yes | alb-cj3w3********1x | The ID of the ALB instance that is protected by WAF. |
| domain | String | Yes | alb.test.com | The domain name that you want to add to WAF for protection. |
Sample request
{
"domain": "alb.test.com",
"instanceId": "alb-cj3w3********1x"
}
ECS domain name (Product is set to ecs and Pattern is set to domain)
Adds a protected object for the domain name of an Elastic Compute Service (ECS) instance protected by WAF.
Parameters
| Name | Type | Required | Example | Description |
| domain | String | Yes | ecs.test.com | The domain name that you want to add to WAF for protection. |
Sample request
{
"domain": "ecs.test.com"
}
CLB domain name (Product is set to clb4 or clb7 and Pattern is set to domain)
Adds a protected object for the domain name of a Classic Load Balancer (CLB) instance protected by WAF.
Parameters
| Name | Type | Required | Example | Description |
| domain | String | Yes | clb.test.com | The domain name that you want to add to WAF for protection. |
Sample request
{
"domain": "clb.test.com"
}
NLB domain name (Product is set to nlb and Pattern is set to domain)
Adds a protected object for the domain name of a Network Load Balancer (NLB) instance protected by WAF.
Parameters
| Name | Type | Required | Example | Description |
| domain | String | Yes | nlb.test.com | The domain name that you want to add to WAF for protection. |
Sample request
{
"domain": "nlb.test.com"
}
WAF hybrid cloud deployment (Product is set to waf and Pattern is set to multi_service)
Creates a protected object for a URL path of a domain name in a hybrid cloud WAF cluster.
Parameters
| Name | Type | Required | Example | Description |
| domain | String | Yes | a.test.com | The domain name or IP address that you want to add to WAF for protection. |
| url | String | Yes | /abc | The URL path. |
Sample request
{
"domain": "a.test.com",
"url": "/abc"
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
1738C613-D054-5191-888B-DC0CF4C3A4A0 |
| Resource |
string |
The name of the protected object that is created. |
cdX.XXX-call.cn-alb |
Examples
Success response
JSON format
{
"RequestId": "1738C613-D054-5191-888B-DC0CF4C3A4A0",
"Resource": "cdX.XXX-call.cn-alb"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Waf.Pullin.ResourceExsit | Access resource already exists, resource:%s. | Access resource already exists, existing resource:%s. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.