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 you want to add the protected object. This parameter is optional. |
testGroup |
| ResourceOrigin |
string |
Yes |
The source of the protected object. Only the following value is supported:
|
custom |
| Pattern |
string |
Yes |
The protection mode of the protected object. Valid values:
|
domain |
| Detail |
string |
Yes |
The detailed parameters of the protected object. This parameter is a string that consists of a JSON struct. Note
The 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 |
Specifies whether to enable the X-Forwarded-For (XFF) proxy. Valid values:
|
0 |
| CustomHeaders |
array |
No |
A list of custom header fields. Note
If you set XffStatus 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 tries to obtain the client IP address from the header fields in sequence. If WAF fails to obtain the client IP address from the specified header fields, it uses the first IP address in the X-Forwarded-For header field. |
|
|
string |
No |
The custom header field. |
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 account to which the protected object belongs. This parameter is used 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 |
A list of tags for the resource. You can add up to 20 tags. |
||
| Key |
string |
No |
The tag key. |
demoTagKey |
| Value |
string |
No |
The tag value. |
TagValue1 |
| ResourceManagerResourceGroupId |
string |
No |
The ID of the Alibaba Cloud resource group. |
rg-acfm***q |
| RegionId |
string |
No |
The region where the WAF instance is deployed. 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. |
Example
{
"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. |
Example
{
"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 Server 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. |
Example
{
"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. |
Example
{
"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 path of a domain name in a WAF hybrid cloud 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. |
Example
{
"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.