SecurityUserRule

class SecurityUserRule : KotlinCustomResource

Network security user rule. Uses Azure REST API version 2024-05-01. In version 2.x of the Azure Native provider, it used API version 2024-03-01. Other available API versions: 2024-03-01, 2024-07-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native network [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

Create a security user rule

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var securityUserRule = new AzureNative.Network.SecurityUserRule("securityUserRule", new()
{
ConfigurationName = "myTestSecurityConfig",
Description = "Sample User Rule",
DestinationPortRanges = new[]
{
"22",
},
Destinations = new[]
{
new AzureNative.Network.Inputs.AddressPrefixItemArgs
{
AddressPrefix = "*",
AddressPrefixType = AzureNative.Network.AddressPrefixType.IPPrefix,
},
},
Direction = AzureNative.Network.SecurityConfigurationRuleDirection.Inbound,
NetworkManagerName = "testNetworkManager",
Protocol = AzureNative.Network.SecurityConfigurationRuleProtocol.Tcp,
ResourceGroupName = "rg1",
RuleCollectionName = "testRuleCollection",
RuleName = "SampleUserRule",
SourcePortRanges = new[]
{
"0-65535",
},
Sources = new[]
{
new AzureNative.Network.Inputs.AddressPrefixItemArgs
{
AddressPrefix = "*",
AddressPrefixType = AzureNative.Network.AddressPrefixType.IPPrefix,
},
},
});
});
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewSecurityUserRule(ctx, "securityUserRule", &network.SecurityUserRuleArgs{
ConfigurationName: pulumi.String("myTestSecurityConfig"),
Description: pulumi.String("Sample User Rule"),
DestinationPortRanges: pulumi.StringArray{
pulumi.String("22"),
},
Destinations: network.AddressPrefixItemArray{
&network.AddressPrefixItemArgs{
AddressPrefix: pulumi.String("*"),
AddressPrefixType: pulumi.String(network.AddressPrefixTypeIPPrefix),
},
},
Direction: pulumi.String(network.SecurityConfigurationRuleDirectionInbound),
NetworkManagerName: pulumi.String("testNetworkManager"),
Protocol: pulumi.String(network.SecurityConfigurationRuleProtocolTcp),
ResourceGroupName: pulumi.String("rg1"),
RuleCollectionName: pulumi.String("testRuleCollection"),
RuleName: pulumi.String("SampleUserRule"),
SourcePortRanges: pulumi.StringArray{
pulumi.String("0-65535"),
},
Sources: network.AddressPrefixItemArray{
&network.AddressPrefixItemArgs{
AddressPrefix: pulumi.String("*"),
AddressPrefixType: pulumi.String(network.AddressPrefixTypeIPPrefix),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.network.SecurityUserRule;
import com.pulumi.azurenative.network.SecurityUserRuleArgs;
import com.pulumi.azurenative.network.inputs.AddressPrefixItemArgs;
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 securityUserRule = new SecurityUserRule("securityUserRule", SecurityUserRuleArgs.builder()
.configurationName("myTestSecurityConfig")
.description("Sample User Rule")
.destinationPortRanges("22")
.destinations(AddressPrefixItemArgs.builder()
.addressPrefix("*")
.addressPrefixType("IPPrefix")
.build())
.direction("Inbound")
.networkManagerName("testNetworkManager")
.protocol("Tcp")
.resourceGroupName("rg1")
.ruleCollectionName("testRuleCollection")
.ruleName("SampleUserRule")
.sourcePortRanges("0-65535")
.sources(AddressPrefixItemArgs.builder()
.addressPrefix("*")
.addressPrefixType("IPPrefix")
.build())
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:network:SecurityUserRule SampleUserRule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val description: Output<String>?

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
val direction: Output<String>

Indicates if the traffic matched against the rule in inbound or outbound.

Link copied to clipboard
val etag: Output<String>

A unique read-only string that changes whenever the resource is updated.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

Resource name.

Link copied to clipboard
val protocol: Output<String>

Network protocol this rule applies to.

Link copied to clipboard

The provisioning state of the security configuration user rule resource.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceGuid: Output<String>

Unique identifier for this resource.

Link copied to clipboard

The source port ranges.

Link copied to clipboard

The CIDR or source IP ranges.

Link copied to clipboard

The system metadata related to this resource.

Link copied to clipboard
val type: Output<String>

Resource type.

Link copied to clipboard
val urn: Output<String>