Creates an access control policy for the NAT firewall.
Operation description
You can call this operation to create a policy to allow, deny, or monitor the traffic that passes through the NAT firewall.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-cloudfirewall:CreateNatFirewallControlPolicy |
create |
*NatFirewallControlPolicy
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Lang |
string |
No |
The language of the content within the request and response. Valid values: Valid values:
|
zh |
| AclAction |
string |
Yes |
The action that is performed on traffic that hits the access control policy. Valid values: Value:
|
log |
| ApplicationNameList |
array |
Yes |
The list of application types that the access control policy supports. |
|
|
string |
No |
The application type that the access control policy supports. |
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 on the destination port is not supported.
Note
If you set DestPortType to group, you do not need to specify a destination port number. The destination port numbers are specified in the 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 instance. |
ngx-xxxxxxx |
| Proto |
string |
Yes |
The protocol type in the access control policy. Valid values:
Note
If the destination address is a domain name that is resolved to an IP address, you can set the protocol type to TCP. The supported application types are HTTP, HTTPS, SMTP, SMTPS, and 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 is specified by a number. A smaller number indicates a higher priority. The priorities of policies start from 1. |
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 you set DestPortType to group, you must specify the name of the destination port address book. |
my_port_group |
| Release |
string |
No |
The status of 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 values:
|
out |
| RepeatType |
string |
No |
The recurrence type for the policy to take effect. Valid values:
|
Permanent |
| RepeatDays |
array |
No |
The days of a week or of a month on which the policy takes effect.
Note
If you set RepeatType to Weekly, the values in the array cannot be repeated.
Note
If you set RepeatType to Monthly, the values in the array cannot be repeated. |
|
|
integer |
No |
The day of a week or of a month on which the policy takes effect. Note
If you set RepeatType to Weekly, the value of this parameter is from 0 to 6. A value of 0 indicates Sunday. If you set RepeatType to Monthly, the value of this parameter is from 1 to 31. |
1 |
|
| RepeatStartTime |
string |
No |
The start time of the recurrence. Example: 08:00. The value must be on the hour or on the half hour, and the start time must be at least 30 minutes earlier than the end time. Note
If you set RepeatType to Permanent or None, leave this parameter empty. If you set RepeatType to Daily, Weekly, or Monthly, you must specify this parameter. |
08:00 |
| RepeatEndTime |
string |
No |
The end time of the recurrence. Example: 23:30. The value must be on the hour or on the half hour, and the end time must be at least 30 minutes later than the start time. Note
If you set RepeatType to Permanent or None, leave this parameter empty. If you set RepeatType to Daily, Weekly, or Monthly, you must specify this parameter. |
23:30 |
| StartTime |
integer |
No |
The start time of the validity period of the policy. The value is a UNIX timestamp. Unit: seconds. The value must be on the hour or on the half hour, and the start time must be at least 30 minutes earlier than the end time. Note
If you set RepeatType to Permanent, leave this parameter empty. If you set RepeatType to None, Daily, Weekly, or Monthly, you must specify this parameter. |
1694761200 |
| EndTime |
integer |
No |
The end time of the validity period of the policy. The value is a UNIX timestamp. Unit: seconds. The value must be on the hour or on the half hour, and the end time must be at least 30 minutes later than the start time. Note
If you set RepeatType to Permanent, leave this parameter empty. If you set RepeatType to None, Daily, Weekly, or Monthly, you must specify this parameter. |
1694764800 |
Response parameters
|
Parameter |
Type |
Description |
Example |
|
object |
|||
| AclUuid |
string |
The UUID of the access control policy. Note
To modify an access control policy, you must provide the UUID of the policy. You can call the DescribeNatFirewallControlPolicy operation to query the UUIDs of access control policies. |
6504d2fb-ab36-49c3-92a6-822a56549783 |
| RequestId |
string |
The ID of the request. |
0DC783F1-B3A7-578D-8A63-687CC9B82C0A |
Examples
Success response
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 | 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 | ErrorAclDomainAnyCountExceed | The number of resolved domain names cannot exceed 200. ACL configuration can be continued for HTTP, HTTPS, SMTP, SMTPS, and SSL applications. | The domain name is resolved to more than 200 IP addresses. We recommend that you set Application in your access control policy to HTTPS, HTTPS, SMTP, SMTPS, or SSL. |
| 400 | ErrorParametersNatGatewayId | Invalid parameters NatGatewayId. | The request parameter NatGatewayId is invalid or does not exist. |
| 400 | ErrorParameterIpVersion | The IP version is invalid. | The IP version is invalid. |
| 400 | ErrorParametersDirection | The direction is invalid. | The direction is invalid. |
| 400 | ErrorDomainResolve | An error occurred while resolving the domain. | An error occurred while resolving the domain. |
| 400 | ErrorParametersPageSizeOrNo | Either pageSize or pageNo is invalid. | Either pageSize or pageNo is invalid. |
| 400 | ErrorMarshalJSON | An error occurred while encoding JSON. | An error occurred while encoding JSON. |
| 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. |
| 400 | ErrorStartTimeOrEndTime | The start time or end time is invalid. The time must be the hour or half hour, and the start time must be 30 minutes earlier than the end time. | The start time or end time is invalid. The time must be an hour or half an hour, and the start time must be 30 minutes earlier than the end time. |
| 400 | ErrorParametersFtpNotSupport | domain destination not support ftp. | FTP application is not supported when the policy destination is a domain name |
| 400 | ErrorAclExtendedCountExceed | ACL or extended ACL rules are not matched. | The quota for access control policies or extra access control policies is exhausted. |
| 400 | ErrorAddressGroupNotExist | The address group does not exist. | The address group does not exist. |
| 400 | ErrorParametersApplicationNameList | Specified parameter ApplicationNameList is not valid. | Specified parameter ApplicationNameList is not valid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.