User Rule Args
data class UserRuleArgs(val configurationName: Output<String>? = null, val description: Output<String>? = null, val destinationPortRanges: Output<List<String>>? = null, val destinations: Output<List<AddressPrefixItemArgs>>? = null, val direction: Output<Either<String, SecurityConfigurationRuleDirection>>? = null, val displayName: Output<String>? = null, val kind: Output<String>? = null, val networkManagerName: Output<String>? = null, val protocol: Output<Either<String, SecurityConfigurationRuleProtocol>>? = null, val resourceGroupName: Output<String>? = null, val ruleCollectionName: Output<String>? = null, val ruleName: Output<String>? = null, val sourcePortRanges: Output<List<String>>? = null, val sources: Output<List<AddressPrefixItemArgs>>? = null) : ConvertibleToJava<UserRuleArgs>
Network security user rule. API Version: 2021-02-01-preview.
Example Usage
Create a default user rule
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var userRule = new AzureNative.Network.UserRule("userRule", new()
{
ConfigurationName = "myTestSecurityConfig",
NetworkManagerName = "testNetworkManager",
ResourceGroupName = "rg1",
RuleCollectionName = "testRuleCollection",
RuleName = "SampleDefaultUserRule",
});
});
Content copied to clipboard
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewUserRule(ctx, "userRule", &network.UserRuleArgs{
ConfigurationName: pulumi.String("myTestSecurityConfig"),
NetworkManagerName: pulumi.String("testNetworkManager"),
ResourceGroupName: pulumi.String("rg1"),
RuleCollectionName: pulumi.String("testRuleCollection"),
RuleName: pulumi.String("SampleDefaultUserRule"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.UserRule;
import com.pulumi.azurenative.network.UserRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var userRule = new UserRule("userRule", UserRuleArgs.builder()
.configurationName("myTestSecurityConfig")
.networkManagerName("testNetworkManager")
.resourceGroupName("rg1")
.ruleCollectionName("testRuleCollection")
.ruleName("SampleDefaultUserRule")
.build());
}
}
Content copied to clipboard
Create a user rule
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var userRule = new AzureNative.Network.UserRule("userRule", new()
{
ConfigurationName = "myTestSecurityConfig",
Description = "Sample User Rule",
DestinationPortRanges = new[]
{
"22",
},
Destinations = new[]
{
new AzureNative.Network.Inputs.AddressPrefixItemArgs
{
AddressPrefix = "*",
AddressPrefixType = "IPPrefix",
},
},
Direction = "Inbound",
Kind = "Custom",
NetworkManagerName = "testNetworkManager",
Protocol = "Tcp",
ResourceGroupName = "rg1",
RuleCollectionName = "testRuleCollection",
RuleName = "SampleUserRule",
SourcePortRanges = new[]
{
"0-65535",
},
Sources = new[]
{
new AzureNative.Network.Inputs.AddressPrefixItemArgs
{
AddressPrefix = "*",
AddressPrefixType = "IPPrefix",
},
},
});
});
Content copied to clipboard
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewUserRule(ctx, "userRule", &network.UserRuleArgs{
ConfigurationName: pulumi.String("myTestSecurityConfig"),
Description: pulumi.String("Sample User Rule"),
DestinationPortRanges: pulumi.StringArray{
pulumi.String("22"),
},
Destinations: []network.AddressPrefixItemArgs{
{
AddressPrefix: pulumi.String("*"),
AddressPrefixType: pulumi.String("IPPrefix"),
},
},
Direction: pulumi.String("Inbound"),
Kind: pulumi.String("Custom"),
NetworkManagerName: pulumi.String("testNetworkManager"),
Protocol: pulumi.String("Tcp"),
ResourceGroupName: pulumi.String("rg1"),
RuleCollectionName: pulumi.String("testRuleCollection"),
RuleName: pulumi.String("SampleUserRule"),
SourcePortRanges: pulumi.StringArray{
pulumi.String("0-65535"),
},
Sources: []network.AddressPrefixItemArgs{
{
AddressPrefix: pulumi.String("*"),
AddressPrefixType: pulumi.String("IPPrefix"),
},
},
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.UserRule;
import com.pulumi.azurenative.network.UserRuleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var userRule = new UserRule("userRule", UserRuleArgs.builder()
.configurationName("myTestSecurityConfig")
.description("Sample User Rule")
.destinationPortRanges("22")
.destinations(Map.ofEntries(
Map.entry("addressPrefix", "*"),
Map.entry("addressPrefixType", "IPPrefix")
))
.direction("Inbound")
.kind("Custom")
.networkManagerName("testNetworkManager")
.protocol("Tcp")
.resourceGroupName("rg1")
.ruleCollectionName("testRuleCollection")
.ruleName("SampleUserRule")
.sourcePortRanges("0-65535")
.sources(Map.ofEntries(
Map.entry("addressPrefix", "*"),
Map.entry("addressPrefixType", "IPPrefix")
))
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:network:UserRule SampleUserRule /subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/SecurityUserConfigurations/Policy1/ruleCollections/testRuleCollection/rules/SampleUserRule
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(configurationName: Output<String>? = null, description: Output<String>? = null, destinationPortRanges: Output<List<String>>? = null, destinations: Output<List<AddressPrefixItemArgs>>? = null, direction: Output<Either<String, SecurityConfigurationRuleDirection>>? = null, displayName: Output<String>? = null, kind: Output<String>? = null, networkManagerName: Output<String>? = null, protocol: Output<Either<String, SecurityConfigurationRuleProtocol>>? = null, resourceGroupName: Output<String>? = null, ruleCollectionName: Output<String>? = null, ruleName: Output<String>? = null, sourcePortRanges: Output<List<String>>? = null, sources: Output<List<AddressPrefixItemArgs>>? = null)
Properties
Link copied to clipboard
The name of the network manager security Configuration.
Link copied to clipboard
A description for this rule.
Link copied to clipboard
The destination port ranges.
Link copied to clipboard
The destination address prefixes. CIDR or destination IP ranges.
Link copied to clipboard
Indicates if the traffic matched against the rule in inbound or outbound.
Link copied to clipboard
A friendly name for the rule.
Link copied to clipboard
The name of the network manager.
Link copied to clipboard
Network protocol this rule applies to.
Link copied to clipboard
The name of the resource group.
Link copied to clipboard
The name of the network manager security Configuration rule collection.
Link copied to clipboard
The source port ranges.
Link copied to clipboard
The CIDR or source IP ranges.