New-AzDdosCustomPolicyDetectionRule
Creates a DDoS custom policy detection rule.
Syntax
Default (Default)
New-AzDdosCustomPolicyDetectionRule
-Name <String>
-TrafficType <String>
-PacketsPerSecond <Int32>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[-AcquirePolicyToken]
[-ChangeReference <String>]
[<CommonParameters>]
Description
The New-AzDdosCustomPolicyDetectionRule cmdlet creates a DDoS custom policy detection rule object. This object is used as input to the New-AzDdosCustomPolicy cmdlet to specify detection rules for a DDoS custom policy.
Examples
Example 1: Create a TCP detection rule
$rule = New-AzDdosCustomPolicyDetectionRule -Name "tcpRule1" -TrafficType Tcp -PacketsPerSecond 1000000
This example creates a TCP detection rule with a threshold of 1,000,000 packets per second.
Example 2: Create multiple detection rules
$tcpRule = New-AzDdosCustomPolicyDetectionRule -Name "tcpRule1" -TrafficType Tcp -PacketsPerSecond 1000000
$udpRule = New-AzDdosCustomPolicyDetectionRule -Name "udpRule1" -TrafficType Udp -PacketsPerSecond 100000
$tcpSynRule = New-AzDdosCustomPolicyDetectionRule -Name "tcpSynRule1" -TrafficType TcpSyn -PacketsPerSecond 50000
This example creates three detection rules with different traffic types and thresholds.
Example 3: Use detection rules with New-AzDdosCustomPolicy
$rule1 = New-AzDdosCustomPolicyDetectionRule -Name "tcpRule1" -TrafficType Tcp -PacketsPerSecond 1000000
$rule2 = New-AzDdosCustomPolicyDetectionRule -Name "udpRule1" -TrafficType Udp -PacketsPerSecond 100000
$policy = New-AzDdosCustomPolicy -ResourceGroupName "myRG" -Name "myPolicy" -Location "eastus" -DetectionRule @($rule1, $rule2)
This example creates two detection rules and uses them to create a new DDoS custom policy.
Parameters
-AcquirePolicyToken
Acquire an Azure Policy token automatically for this resource operation.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ChangeReference
The change reference resource ID for this resource operation.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: cf
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
Type: IAzureContextContainer
Default value: None
Supports wildcards: False
DontShow: False
Aliases: AzContext, AzureRmContext, AzureCredential
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-Name
Specifies the name of the detection rule.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-PacketsPerSecond
Specifies the packets per second threshold for the DDoS detection rule.
Parameter properties
Type: Int32
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-TrafficType
Specifies the traffic type for the DDoS detection rule. The acceptable values for this parameter are:
Parameter properties
Type: String
Default value: None
Accepted values: Tcp, Udp, TcpSyn
Supports wildcards: False
DontShow: False
Parameter sets
(All)
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: SwitchParameter
Default value: None
Supports wildcards: False
DontShow: False
Aliases: wi
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters .
Outputs
Microsoft.Azure.Commands.Network.Models.PSDdosCustomPolicyDetectionRule