Security Rule Args
data class SecurityRuleArgs(val access: Output<Either<String, SecurityRuleAccess>>? = null, val description: Output<String>? = null, val destinationAddressPrefix: Output<String>? = null, val destinationAddressPrefixes: Output<List<String>>? = null, val destinationApplicationSecurityGroups: Output<List<ApplicationSecurityGroupArgs>>? = null, val destinationPortRange: Output<String>? = null, val destinationPortRanges: Output<List<String>>? = null, val direction: Output<Either<String, SecurityRuleDirection>>? = null, val id: Output<String>? = null, val name: Output<String>? = null, val networkSecurityGroupName: Output<String>? = null, val priority: Output<Int>? = null, val protocol: Output<Either<String, SecurityRuleProtocol>>? = null, val resourceGroupName: Output<String>? = null, val securityRuleName: Output<String>? = null, val sourceAddressPrefix: Output<String>? = null, val sourceAddressPrefixes: Output<List<String>>? = null, val sourceApplicationSecurityGroups: Output<List<ApplicationSecurityGroupArgs>>? = null, val sourcePortRange: Output<String>? = null, val sourcePortRanges: Output<List<String>>? = null, val type: Output<String>? = null) : ConvertibleToJava<SecurityRuleArgs>
Network security rule. Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2020-11-01. Other available API versions: 2017-03-01, 2019-06-01, 2022-07-01, 2023-04-01, 2023-05-01.
Example Usage
Create security rule
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var securityRule = new AzureNative.Network.SecurityRule("securityRule", new()
{
Access = "Deny",
DestinationAddressPrefix = "11.0.0.0/8",
DestinationPortRange = "8080",
Direction = "Outbound",
NetworkSecurityGroupName = "testnsg",
Priority = 100,
Protocol = "*",
ResourceGroupName = "rg1",
SecurityRuleName = "rule1",
SourceAddressPrefix = "10.0.0.0/8",
SourcePortRange = "*",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/network/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewSecurityRule(ctx, "securityRule", &network.SecurityRuleArgs{
Access: pulumi.String("Deny"),
DestinationAddressPrefix: pulumi.String("11.0.0.0/8"),
DestinationPortRange: pulumi.String("8080"),
Direction: pulumi.String("Outbound"),
NetworkSecurityGroupName: pulumi.String("testnsg"),
Priority: pulumi.Int(100),
Protocol: pulumi.String("*"),
ResourceGroupName: pulumi.String("rg1"),
SecurityRuleName: pulumi.String("rule1"),
SourceAddressPrefix: pulumi.String("10.0.0.0/8"),
SourcePortRange: pulumi.String("*"),
})
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.SecurityRule;
import com.pulumi.azurenative.network.SecurityRuleArgs;
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 securityRule = new SecurityRule("securityRule", SecurityRuleArgs.builder()
.access("Deny")
.destinationAddressPrefix("11.0.0.0/8")
.destinationPortRange("8080")
.direction("Outbound")
.networkSecurityGroupName("testnsg")
.priority(100)
.protocol("*")
.resourceGroupName("rg1")
.securityRuleName("rule1")
.sourceAddressPrefix("10.0.0.0/8")
.sourcePortRange("*")
.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:SecurityRule rule1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}
Content copied to clipboard
Constructors
Link copied to clipboard
fun SecurityRuleArgs(access: Output<Either<String, SecurityRuleAccess>>? = null, description: Output<String>? = null, destinationAddressPrefix: Output<String>? = null, destinationAddressPrefixes: Output<List<String>>? = null, destinationApplicationSecurityGroups: Output<List<ApplicationSecurityGroupArgs>>? = null, destinationPortRange: Output<String>? = null, destinationPortRanges: Output<List<String>>? = null, direction: Output<Either<String, SecurityRuleDirection>>? = null, id: Output<String>? = null, name: Output<String>? = null, networkSecurityGroupName: Output<String>? = null, priority: Output<Int>? = null, protocol: Output<Either<String, SecurityRuleProtocol>>? = null, resourceGroupName: Output<String>? = null, securityRuleName: Output<String>? = null, sourceAddressPrefix: Output<String>? = null, sourceAddressPrefixes: Output<List<String>>? = null, sourceApplicationSecurityGroups: Output<List<ApplicationSecurityGroupArgs>>? = null, sourcePortRange: Output<String>? = null, sourcePortRanges: Output<List<String>>? = null, type: Output<String>? = null)
Functions
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard