![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azurenative.network.kotlin.UserRuleArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-native-kotlin Show documentation
Show all versions of pulumi-azure-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.network.kotlin
import com.pulumi.azurenative.network.UserRuleArgs.builder
import com.pulumi.azurenative.network.kotlin.enums.SecurityConfigurationRuleDirection
import com.pulumi.azurenative.network.kotlin.enums.SecurityConfigurationRuleProtocol
import com.pulumi.azurenative.network.kotlin.inputs.AddressPrefixItemArgs
import com.pulumi.azurenative.network.kotlin.inputs.AddressPrefixItemArgsBuilder
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Network security user rule.
* Azure REST API version: 2022-04-01-preview. Prior API version in Azure Native 1.x: 2021-02-01-preview.
* Other available API versions: 2021-05-01-preview.
* ## Example Usage
* ### Create a default user rule
* ```csharp
* 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",
* });
* });
* ```
* ```go
* package main
* import (
* network "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.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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ### Create a user rule
* ```csharp
* 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 = AzureNative.Network.AddressPrefixType.IPPrefix,
* },
* },
* Direction = AzureNative.Network.SecurityConfigurationRuleDirection.Inbound,
* Kind = "Custom",
* 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,
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* network "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.NewUserRule(ctx, "userRule", &network.UserRuleArgs{
* 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),
* Kind: pulumi.String("Custom"),
* 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
* })
* }
* ```
* ```java
* 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 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 userRule = new UserRule("userRule", UserRuleArgs.builder()
* .configurationName("myTestSecurityConfig")
* .description("Sample User Rule")
* .destinationPortRanges("22")
* .destinations(AddressPrefixItemArgs.builder()
* .addressPrefix("*")
* .addressPrefixType("IPPrefix")
* .build())
* .direction("Inbound")
* .kind("Custom")
* .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.
* ```sh
* $ pulumi import azure-native:network:UserRule SampleUserRule /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}
* ```
* @property configurationName The name of the network manager Security Configuration.
* @property description A description for this rule.
* @property destinationPortRanges The destination port ranges.
* @property destinations The destination address prefixes. CIDR or destination IP ranges.
* @property direction Indicates if the traffic matched against the rule in inbound or outbound.
* @property kind Whether the rule is custom or default.
* Expected value is 'Custom'.
* @property networkManagerName The name of the network manager.
* @property protocol Network protocol this rule applies to.
* @property resourceGroupName The name of the resource group.
* @property ruleCollectionName The name of the network manager security Configuration rule collection.
* @property ruleName The name of the rule.
* @property sourcePortRanges The source port ranges.
* @property sources The CIDR or source IP ranges.
*/
public data class UserRuleArgs(
public val configurationName: Output? = null,
public val description: Output? = null,
public val destinationPortRanges: Output>? = null,
public val destinations: Output>? = null,
public val direction: Output>? = null,
public val kind: Output? = null,
public val networkManagerName: Output? = null,
public val protocol: Output>? = null,
public val resourceGroupName: Output? = null,
public val ruleCollectionName: Output? = null,
public val ruleName: Output? = null,
public val sourcePortRanges: Output>? = null,
public val sources: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.network.UserRuleArgs =
com.pulumi.azurenative.network.UserRuleArgs.builder()
.configurationName(configurationName?.applyValue({ args0 -> args0 }))
.description(description?.applyValue({ args0 -> args0 }))
.destinationPortRanges(destinationPortRanges?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.destinations(
destinations?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.direction(
direction?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.kind(kind?.applyValue({ args0 -> args0 }))
.networkManagerName(networkManagerName?.applyValue({ args0 -> args0 }))
.protocol(
protocol?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.ruleCollectionName(ruleCollectionName?.applyValue({ args0 -> args0 }))
.ruleName(ruleName?.applyValue({ args0 -> args0 }))
.sourcePortRanges(sourcePortRanges?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.sources(
sources?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
).build()
}
/**
* Builder for [UserRuleArgs].
*/
@PulumiTagMarker
public class UserRuleArgsBuilder internal constructor() {
private var configurationName: Output? = null
private var description: Output? = null
private var destinationPortRanges: Output>? = null
private var destinations: Output>? = null
private var direction: Output>? = null
private var kind: Output? = null
private var networkManagerName: Output? = null
private var protocol: Output>? = null
private var resourceGroupName: Output? = null
private var ruleCollectionName: Output? = null
private var ruleName: Output? = null
private var sourcePortRanges: Output>? = null
private var sources: Output>? = null
/**
* @param value The name of the network manager Security Configuration.
*/
@JvmName("bwcwdpgslmpgwjaj")
public suspend fun configurationName(`value`: Output) {
this.configurationName = value
}
/**
* @param value A description for this rule.
*/
@JvmName("fcmqqesvsiekrtgt")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value The destination port ranges.
*/
@JvmName("ekvtihhyljbagjqd")
public suspend fun destinationPortRanges(`value`: Output>) {
this.destinationPortRanges = value
}
@JvmName("sidykineqekuebyn")
public suspend fun destinationPortRanges(vararg values: Output) {
this.destinationPortRanges = Output.all(values.asList())
}
/**
* @param values The destination port ranges.
*/
@JvmName("qjpgvcephqwlklsy")
public suspend fun destinationPortRanges(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy