Creates an access control policy for a NAT firewall.
Operation description
You can call this operation to create a policy that allows, denies, or monitors the traffic that passes through the NAT firewall.
Debugging
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:
- The required resource types are displayed in bold characters.
- 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
yundun-cloudfirewall:CreateNatFirewallControlPolicy | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Lang | string | No | The language of the content within the response. Valid values:
| zh |
AclAction | string | Yes | The action that Cloud Firewall performs on the traffic. Valid values:
| log |
ApplicationNameList | array | Yes | The application types supported by the access control policy. | |
string | Yes | The application type supported by the access control policy. | ANY | |
Description | string | Yes | The description of the access control policy. | allow |
DestPort | string | No | The destination port in the access control policy. Valid values:
Note
If Proto is set to ICMP, access control does not take effect on the destination port.
Note
If DestPortType is set to group, you do not need to specify the destination port number. All ports on which the access control policy takes effect are included in the destination port address book.
| 80 |
Destination | string | Yes | The destination address in the access control policy. Valid values:
| XX.XX.XX.XX/24 |
DestinationType | string | Yes | The type of the destination address in the access control policy. Valid values:
| net |
NatGatewayId | string | Yes | The ID of the NAT gateway. | ngx-xxxxxxx |
Proto | string | Yes | The protocol type in the access control policy. Valid values:
Note
If the destination address is a threat intelligence address book of the domain name type or a cloud service address book, you can set Proto only to TCP and set ApplicationNameList to HTTP, HTTPS, SMTP, SMTPS, or SSL.
| ANY |
Source | string | Yes | The source address in the access control policy. Valid values:
| 192.168.0.25/32 |
SourceType | string | Yes | The type of the source address in the access control policy. Valid values:
| net |
NewOrder | string | Yes | The priority of the access control policy. The priority value starts from 1. A small priority value indicates a high priority. | 1 |
DestPortType | string | No | The type of the destination port in the access control policy. Valid values:
| port |
DestPortGroup | string | No | The name of the destination port address book in the access control policy. Note
If DestPortType is set to group, you must specify the name of the destination port address book.
| my_port_group |
Release | string | No | Specifies whether to enable the access control policy. By default, an access control policy is enabled after it is created. Valid values:
| true |
DomainResolveType | integer | No | The domain name resolution method of the access control policy. Valid values:
| 0 |
IpVersion | string | No | The IP version supported by the access control policy. Valid values:
| 4 |
Direction | string | Yes | The direction of the traffic to which the access control policy applies. Valid value:
| out |
RepeatType | string | No | The recurrence type for the access control policy to take effect. Valid values:
| Permanent |
RepeatDays | array | No | The days of a week or of a month on which the access control policy takes effect.
Note
If RepeatType is set to Weekly, the fields in the value of RepeatDays cannot be repeated.
Note
If RepeatType is set to Monthly, the fields in the value of RepeatDays cannot be repeated.
| |
long | No | The day of a week or of a month on which the access control policy takes effect. Note
If RepeatType is set to Weekly, valid values of this parameter are 0 to 6. Each week starts from Sunday. If RepeatType is set to Monthly, valid values of this parameter are 1 to 31.
| 1 | |
RepeatStartTime | string | No | The point in time when the recurrence starts. Example: 08:00. The value must be on the hour or on the half hour, and at least 30 minutes earlier than the value of RepeatEndTime. Note
If RepeatType is set to Permanent or None, RepeatStartTime is left empty. If RepeatType is set to Daily, Weekly, or Monthly, this parameter must be specified.
| 08:00 |
RepeatEndTime | string | No | The point in time when the recurrence ends. Example: 23:30. The value must be on the hour or on the half hour, and at least 30 minutes later than the value of RepeatStartTime. Note
If RepeatType is set to Permanent or None, RepeatEndTime is left empty. If RepeatType is set to Daily, Weekly, or Monthly, this parameter must be specified.
| 23:30 |
StartTime | long | No | The time when the access control policy starts to take effect. The value is a UNIX timestamp. Unit: seconds. The value must be on the hour or on the half hour, and at least 30 minutes earlier than the value of EndTime. Note
If RepeatType is set to Permanent, StartTime is left empty. If RepeatType is set to None, Daily, Weekly, or Monthly, this parameter must be specified.
| 1694761200 |
EndTime | long | No | The time when the access control policy stops taking effect. The value is a UNIX timestamp. Unit: seconds. The value must be on the hour or on the half hour, and at least 30 minutes later than the value of StartTime. Note
If RepeatType is set to Permanent, EndTime is left empty. If RepeatType is set to None, Daily, Weekly, or Monthly, this parameter must be specified.
| 1694764800 |
Response parameters
Examples
Sample success responses
JSON
format
{
"AclUuid": "6504d2fb-ab36-49c3-92a6-822a56549783",
"RequestId": "0DC783F1-B3A7-578D-8A63-687CC9B82C0A"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | ErrorParametersUid | The aliUid parameter is invalid. | The aliUid parameter is invalid. |
400 | ErrorUUIDNew | The UUID is invalid. | The UUID is invalid. |
400 | ErrorParametersSource | The source is invalid. | The source is invalid. |
400 | ErrorParametersDestination | The Destination parameter is invalid. | The Destination parameter is invalid. |
400 | ErrorParametersProto | The protocol is invalid. | The protocol is invalid. |
400 | ErrorParametersDestPort | The dst_port is invalid. | The dst_port is invalid. |
400 | ErrorParametersAction | The action is invalid. | The action is invalid. |
400 | ErrorParametersAppId | The AppId parameter is incorrect. | The AppId parameter is invalid. |
400 | ErrorDBSelect | An error occurred while querying database. | An error occurred while querying database. |
400 | ErrorParameters | A parameter error occurred. | A parameter error occurred. |
400 | ErrorAddressCountExceed | The maximum number of addresses is exceeded. | The maximum number of address is exceeded. |
400 | ErrorParametersNewOrder | The newOrder is invalid. | The newOrder is invalid. |
400 | ErrorDBInsert | An error occurred while performing an insert operation in the database. | An error occurred while performing an insert operation in the database. |
400 | ErrorDBDelete | An error occurred while deleting the database. | An error occurred while deleting the database. |
400 | ErrorRecordLog | An error occurred while updating the operation log. | An error occurred while updating the operation log. |
400 | ErrorParametersDestinationCount | Exceeding the number of countries in a single ACL. | Exceeds the number of selected areas for one ACL. It is recommended to split it into multiple ACLs. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-08-22 | The Error code has changed | View Change Details |
2024-03-13 | The Error code has changed | View Change Details |
2023-10-12 | The Error code has changed. The request parameters of the API has changed | View Change Details |