New-AzDdosProtectionPlan
Bir DDoS koruma planı oluşturur.
Syntax
New-AzDdosProtectionPlan
-ResourceGroupName <String>
-Name <String>
-Location <String>
[-Tag <Hashtable>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
New-AzDdosProtectionPlan cmdlet'i bir DDoS koruma planı oluşturur.
Örnekler
Örnek 1: DDoS koruma planı oluşturma ve yeni bir sanal ağ ile ilişkilendirme
$ddosProtectionPlan = New-AzDdosProtectionPlan -ResourceGroupName ResourceGroupName -Name DdosProtectionPlanName -Location "West US"
$subnet = New-AzVirtualNetworkSubnetConfig -Name SubnetName -AddressPrefix 10.0.1.0/24
$vnet = New-AzVirtualNetwork -Name VnetName -ResourceGroupName ResourceGroupName -Location "West US" -AddressPrefix 10.0.0.0/16 -DnsServer 8.8.8.8 -Subnet $subnet -EnableDdoSProtection -DdosProtectionPlanId $ddosProtectionPlan.Id
İlk olarak New-AzDdosProtectionPlan komutuyla yeni bir DDoS Koruması planı oluşturacağız. Ardından New-AzVirtualNetwork ile yeni bir sanal ağ oluşturur ve DdosProtectionPlanId parametresinde yeni oluşturulan planın kimliğini belirtiriz. Bu durumda, sanal ağı bir planla ilişkilendirdiğimiz için EnableDdoSProtection parametresini de belirtebiliriz.
Örnek 2: DDoS koruma planı oluşturma ve mevcut bir sanal ağ ile ilişkilendirme
$ddosProtectionPlan = New-AzDdosProtectionPlan -ResourceGroupName ResourceGroupName -Name DdosProtectionPlanName -Location "West US"
$vnet = Get-AzVirtualNetwork -Name VnetName -ResourceGroupName ResourceGroupName
$vnet.DdosProtectionPlan = New-Object Microsoft.Azure.Commands.Network.Models.PSResourceId
$vnet.DdosProtectionPlan.Id = $ddosProtectionPlan.Id
$vnet.EnableDdosProtection = $true
$vnet | Set-AzVirtualNetwork
Name : VnetName
ResourceGroupName : ResourceGroupName
Location : westus
Id : /subscriptions/d1dbd366-9871-45ac-84b7-fb318152a9e0/resourceGroups/ResourceGroupName/providers/Microsoft.Network/virtualNetworks/VnetName
Etag : W/"fbf41754-3c13-43fd-bb5b-fcc37d5e1cbb"
ResourceGuid : fcb7bc1e-ee0d-4005-b3f1-feda76e3756c
ProvisioningState : Succeeded
Tags :
AddressSpace : {
"AddressPrefixes": [
"10.0.0.0/16"
]
}
DhcpOptions : {
"DnsServers": [
"8.8.8.8"
]
}
Subnets : [
{
"Name": "SubnetName",
"Etag": "W/\"fbf41754-3c13-43fd-bb5b-fcc37d5e1cbb\"",
"Id": "/subscriptions/d1dbd366-9871-45ac-84b7-fb318152a9e0/resourceGroups/ResourceGroupName/providers/Microsoft.Network/virtualNetworks/VnetName/subnets/SubnetName",
"AddressPrefix": "10.0.1.0/24",
"IpConfigurations": [],
"ResourceNavigationLinks": [],
"ServiceEndpoints": [],
"ProvisioningState": "Succeeded"
}
]
VirtualNetworkPeerings : []
EnableDdosProtection : true
DdosProtectionPlan : {
"Id": "/subscriptions/d1dbd366-9871-45ac-84b7-fb318152a9e0/resourceGroups/ResourceGroupName/providers/Microsoft.Network/ddosProtectionPlans/DdosProtectionPlanName"
}
EnableVmProtection : false
İlk olarak New-AzDdosProtectionPlan komutuyla yeni bir DDoS Koruması planı oluşturacağız. İkincisi, planla ilişkilendirmek istediğimiz sanal ağın en güncel sürümünü elde ediyoruz. DdosProtectionPlan özelliğini, yeni oluşturulan planın kimliğine başvuru içeren bir PSResourceId nesnesiyle güncelleştiriyoruz. Bu durumda, sanal ağı bir DDoS koruma planıyla ilişkilendirirsek EnableDdosProtection bayrağını true olarak da ayarlayabiliriz. Son olarak, yerel değişkeni Set-AzVirtualNetwork içine getirerek yeni durumu kalıcı hale getireceğiz.
Parametreler
-AsJob
Cmdlet'i arka planda çalıştırma
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Cmdlet'i çalıştırmadan önce sizden onay ister.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
Azure ile iletişim için kullanılan kimlik bilgileri, hesap, kiracı ve abonelik.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Location
Oluşturulacak DDoS koruma planının konumunu belirtir.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Oluşturulacak DDoS koruma planının adını belirtir.
Type: | String |
Aliases: | ResourceName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
Oluşturulacak DDoS koruma planının kaynak grubunu belirtir.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Tag
Kaynak etiketlerini temsil eden bir karma tablo.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Cmdlet çalıştırılıyorsa ne olacağını gösterir. Cmdlet çalıştırılmaz.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Girişler
Çıkışlar
İlişkili Bağlantılar
Azure PowerShell
Geri Bildirim
https://aka.ms/ContentUserFeedback.
Çok yakında: 2024 boyunca, içerik için geri bildirim mekanizması olarak GitHub Sorunları’nı kullanımdan kaldıracak ve yeni bir geri bildirim sistemiyle değiştireceğiz. Daha fazla bilgi için bkz.Gönderin ve geri bildirimi görüntüleyin