All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.network.kotlin.SecurityRuleArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.network.kotlin

import com.pulumi.azurenative.network.SecurityRuleArgs.builder
import com.pulumi.azurenative.network.kotlin.enums.SecurityRuleAccess
import com.pulumi.azurenative.network.kotlin.enums.SecurityRuleDirection
import com.pulumi.azurenative.network.kotlin.enums.SecurityRuleProtocol
import com.pulumi.azurenative.network.kotlin.inputs.ApplicationSecurityGroupArgs
import com.pulumi.azurenative.network.kotlin.inputs.ApplicationSecurityGroupArgsBuilder
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * 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, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.
 * ## Example Usage
 * ### Create security rule
 * ```csharp
 * 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 = AzureNative.Network.SecurityRuleAccess.Deny,
 *         DestinationAddressPrefix = "11.0.0.0/8",
 *         DestinationPortRange = "8080",
 *         Direction = AzureNative.Network.SecurityRuleDirection.Outbound,
 *         NetworkSecurityGroupName = "testnsg",
 *         Priority = 100,
 *         Protocol = AzureNative.Network.SecurityRuleProtocol.Asterisk,
 *         ResourceGroupName = "rg1",
 *         SecurityRuleName = "rule1",
 *         SourceAddressPrefix = "10.0.0.0/8",
 *         SourcePortRange = "*",
 *     });
 * });
 * ```
 * ```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.NewSecurityRule(ctx, "securityRule", &network.SecurityRuleArgs{
 * 			Access:                   pulumi.String(network.SecurityRuleAccessDeny),
 * 			DestinationAddressPrefix: pulumi.String("11.0.0.0/8"),
 * 			DestinationPortRange:     pulumi.String("8080"),
 * 			Direction:                pulumi.String(network.SecurityRuleDirectionOutbound),
 * 			NetworkSecurityGroupName: pulumi.String("testnsg"),
 * 			Priority:                 pulumi.Int(100),
 * 			Protocol:                 pulumi.String(network.SecurityRuleProtocolAsterisk),
 * 			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
 * 	})
 * }
 * ```
 * ```java
 * 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());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:network:SecurityRule rule1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}
 * ```
 * @property access The network traffic is allowed or denied.
 * @property description A description for this rule. Restricted to 140 chars.
 * @property destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
 * @property destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges.
 * @property destinationApplicationSecurityGroups The application security group specified as destination.
 * @property destinationPortRange The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
 * @property destinationPortRanges The destination port ranges.
 * @property direction The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
 * @property id Resource ID.
 * @property name The name of the resource that is unique within a resource group. This name can be used to access the resource.
 * @property networkSecurityGroupName The name of the network security group.
 * @property priority The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
 * @property protocol Network protocol this rule applies to.
 * @property resourceGroupName The name of the resource group.
 * @property securityRuleName The name of the security rule.
 * @property sourceAddressPrefix The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
 * @property sourceAddressPrefixes The CIDR or source IP ranges.
 * @property sourceApplicationSecurityGroups The application security group specified as source.
 * @property sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
 * @property sourcePortRanges The source port ranges.
 * @property type The type of the resource.
 */
public data class SecurityRuleArgs(
    public val access: Output>? = null,
    public val description: Output? = null,
    public val destinationAddressPrefix: Output? = null,
    public val destinationAddressPrefixes: Output>? = null,
    public val destinationApplicationSecurityGroups: Output>? =
        null,
    public val destinationPortRange: Output? = null,
    public val destinationPortRanges: Output>? = null,
    public val direction: Output>? = null,
    public val id: Output? = null,
    public val name: Output? = null,
    public val networkSecurityGroupName: Output? = null,
    public val priority: Output? = null,
    public val protocol: Output>? = null,
    public val resourceGroupName: Output? = null,
    public val securityRuleName: Output? = null,
    public val sourceAddressPrefix: Output? = null,
    public val sourceAddressPrefixes: Output>? = null,
    public val sourceApplicationSecurityGroups: Output>? = null,
    public val sourcePortRange: Output? = null,
    public val sourcePortRanges: Output>? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.network.SecurityRuleArgs =
        com.pulumi.azurenative.network.SecurityRuleArgs.builder()
            .access(
                access?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .description(description?.applyValue({ args0 -> args0 }))
            .destinationAddressPrefix(destinationAddressPrefix?.applyValue({ args0 -> args0 }))
            .destinationAddressPrefixes(
                destinationAddressPrefixes?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .destinationApplicationSecurityGroups(
                destinationApplicationSecurityGroups?.applyValue({ args0 ->
                    args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) })
                }),
            )
            .destinationPortRange(destinationPortRange?.applyValue({ args0 -> args0 }))
            .destinationPortRanges(destinationPortRanges?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .direction(
                direction?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .id(id?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .networkSecurityGroupName(networkSecurityGroupName?.applyValue({ args0 -> args0 }))
            .priority(priority?.applyValue({ args0 -> args0 }))
            .protocol(
                protocol?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .securityRuleName(securityRuleName?.applyValue({ args0 -> args0 }))
            .sourceAddressPrefix(sourceAddressPrefix?.applyValue({ args0 -> args0 }))
            .sourceAddressPrefixes(sourceAddressPrefixes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .sourceApplicationSecurityGroups(
                sourceApplicationSecurityGroups?.applyValue({ args0 ->
                    args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) })
                }),
            )
            .sourcePortRange(sourcePortRange?.applyValue({ args0 -> args0 }))
            .sourcePortRanges(sourcePortRanges?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .type(type?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SecurityRuleArgs].
 */
@PulumiTagMarker
public class SecurityRuleArgsBuilder internal constructor() {
    private var access: Output>? = null

    private var description: Output? = null

    private var destinationAddressPrefix: Output? = null

    private var destinationAddressPrefixes: Output>? = null

    private var destinationApplicationSecurityGroups: Output>? =
        null

    private var destinationPortRange: Output? = null

    private var destinationPortRanges: Output>? = null

    private var direction: Output>? = null

    private var id: Output? = null

    private var name: Output? = null

    private var networkSecurityGroupName: Output? = null

    private var priority: Output? = null

    private var protocol: Output>? = null

    private var resourceGroupName: Output? = null

    private var securityRuleName: Output? = null

    private var sourceAddressPrefix: Output? = null

    private var sourceAddressPrefixes: Output>? = null

    private var sourceApplicationSecurityGroups: Output>? = null

    private var sourcePortRange: Output? = null

    private var sourcePortRanges: Output>? = null

    private var type: Output? = null

    /**
     * @param value The network traffic is allowed or denied.
     */
    @JvmName("fwdsodqmdstfhhnq")
    public suspend fun access(`value`: Output>) {
        this.access = value
    }

    /**
     * @param value A description for this rule. Restricted to 140 chars.
     */
    @JvmName("jbuvgqtjxcedwusn")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
     */
    @JvmName("idbxtitmukrdniqu")
    public suspend fun destinationAddressPrefix(`value`: Output) {
        this.destinationAddressPrefix = value
    }

    /**
     * @param value The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("fhnisqdydcubrpgv")
    public suspend fun destinationAddressPrefixes(`value`: Output>) {
        this.destinationAddressPrefixes = value
    }

    @JvmName("ygnulvnkpdsxiark")
    public suspend fun destinationAddressPrefixes(vararg values: Output) {
        this.destinationAddressPrefixes = Output.all(values.asList())
    }

    /**
     * @param values The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("kxqbfygbgvpxjawr")
    public suspend fun destinationAddressPrefixes(values: List>) {
        this.destinationAddressPrefixes = Output.all(values)
    }

    /**
     * @param value The application security group specified as destination.
     */
    @JvmName("vdenkbepkkpqjubt")
    public suspend fun destinationApplicationSecurityGroups(`value`: Output>) {
        this.destinationApplicationSecurityGroups = value
    }

    @JvmName("dccenapxuiohwvhi")
    public suspend fun destinationApplicationSecurityGroups(vararg values: Output) {
        this.destinationApplicationSecurityGroups = Output.all(values.asList())
    }

    /**
     * @param values The application security group specified as destination.
     */
    @JvmName("yujftxjokxywsrdu")
    public suspend fun destinationApplicationSecurityGroups(values: List>) {
        this.destinationApplicationSecurityGroups = Output.all(values)
    }

    /**
     * @param value The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
     */
    @JvmName("pruqtngdynyktyxv")
    public suspend fun destinationPortRange(`value`: Output) {
        this.destinationPortRange = value
    }

    /**
     * @param value The destination port ranges.
     */
    @JvmName("muqtqcssglciwexj")
    public suspend fun destinationPortRanges(`value`: Output>) {
        this.destinationPortRanges = value
    }

    @JvmName("pxwrydnwfpmkjlti")
    public suspend fun destinationPortRanges(vararg values: Output) {
        this.destinationPortRanges = Output.all(values.asList())
    }

    /**
     * @param values The destination port ranges.
     */
    @JvmName("akwvielkfceumrtq")
    public suspend fun destinationPortRanges(values: List>) {
        this.destinationPortRanges = Output.all(values)
    }

    /**
     * @param value The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
     */
    @JvmName("ugglrcquoxtnkixo")
    public suspend fun direction(`value`: Output>) {
        this.direction = value
    }

    /**
     * @param value Resource ID.
     */
    @JvmName("wetflicuasgaapar")
    public suspend fun id(`value`: Output) {
        this.id = value
    }

    /**
     * @param value The name of the resource that is unique within a resource group. This name can be used to access the resource.
     */
    @JvmName("wkpnhptbharasylc")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the network security group.
     */
    @JvmName("ydbrlhtrxypgkyxd")
    public suspend fun networkSecurityGroupName(`value`: Output) {
        this.networkSecurityGroupName = value
    }

    /**
     * @param value The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
     */
    @JvmName("ijntxxrhwwbsivle")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value Network protocol this rule applies to.
     */
    @JvmName("fudwkrwwkylwpbwj")
    public suspend fun protocol(`value`: Output>) {
        this.protocol = value
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("hkgpyikyujgfedaq")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the security rule.
     */
    @JvmName("jurceqhcelufkthf")
    public suspend fun securityRuleName(`value`: Output) {
        this.securityRuleName = value
    }

    /**
     * @param value The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
     */
    @JvmName("ownccukjbqtwjpuy")
    public suspend fun sourceAddressPrefix(`value`: Output) {
        this.sourceAddressPrefix = value
    }

    /**
     * @param value The CIDR or source IP ranges.
     */
    @JvmName("ppitaeqalwkkmpci")
    public suspend fun sourceAddressPrefixes(`value`: Output>) {
        this.sourceAddressPrefixes = value
    }

    @JvmName("oehwlohyojmcktkg")
    public suspend fun sourceAddressPrefixes(vararg values: Output) {
        this.sourceAddressPrefixes = Output.all(values.asList())
    }

    /**
     * @param values The CIDR or source IP ranges.
     */
    @JvmName("qsxncinnvhktcihw")
    public suspend fun sourceAddressPrefixes(values: List>) {
        this.sourceAddressPrefixes = Output.all(values)
    }

    /**
     * @param value The application security group specified as source.
     */
    @JvmName("wtuphgjmifkardqd")
    public suspend fun sourceApplicationSecurityGroups(`value`: Output>) {
        this.sourceApplicationSecurityGroups = value
    }

    @JvmName("sdxxxjljsdsbfvfg")
    public suspend fun sourceApplicationSecurityGroups(vararg values: Output) {
        this.sourceApplicationSecurityGroups = Output.all(values.asList())
    }

    /**
     * @param values The application security group specified as source.
     */
    @JvmName("hapkjvfosgmsojhs")
    public suspend fun sourceApplicationSecurityGroups(values: List>) {
        this.sourceApplicationSecurityGroups = Output.all(values)
    }

    /**
     * @param value The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
     */
    @JvmName("svmcgooeaaymrcnb")
    public suspend fun sourcePortRange(`value`: Output) {
        this.sourcePortRange = value
    }

    /**
     * @param value The source port ranges.
     */
    @JvmName("bwgosfnsjweragsb")
    public suspend fun sourcePortRanges(`value`: Output>) {
        this.sourcePortRanges = value
    }

    @JvmName("uaywynpbmquiqalg")
    public suspend fun sourcePortRanges(vararg values: Output) {
        this.sourcePortRanges = Output.all(values.asList())
    }

    /**
     * @param values The source port ranges.
     */
    @JvmName("gahhtyfmethpdxbm")
    public suspend fun sourcePortRanges(values: List>) {
        this.sourcePortRanges = Output.all(values)
    }

    /**
     * @param value The type of the resource.
     */
    @JvmName("jqqiwuduaseiicso")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value The network traffic is allowed or denied.
     */
    @JvmName("entbdijkjjfnpovi")
    public suspend fun access(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.access = mapped
    }

    /**
     * @param value The network traffic is allowed or denied.
     */
    @JvmName("tdkmnbsksiqessdw")
    public fun access(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.access = mapped
    }

    /**
     * @param value The network traffic is allowed or denied.
     */
    @JvmName("crvtdqtlqyogplra")
    public fun access(`value`: SecurityRuleAccess) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.access = mapped
    }

    /**
     * @param value A description for this rule. Restricted to 140 chars.
     */
    @JvmName("wndiaonphvvaysto")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
     */
    @JvmName("gwvfrrwgbaunwwee")
    public suspend fun destinationAddressPrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationAddressPrefix = mapped
    }

    /**
     * @param value The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("hxsgkgtidhmrmdwq")
    public suspend fun destinationAddressPrefixes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationAddressPrefixes = mapped
    }

    /**
     * @param values The destination address prefixes. CIDR or destination IP ranges.
     */
    @JvmName("itrkxoxinuyreaei")
    public suspend fun destinationAddressPrefixes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinationAddressPrefixes = mapped
    }

    /**
     * @param value The application security group specified as destination.
     */
    @JvmName("jbqunpleiobjwbbl")
    public suspend fun destinationApplicationSecurityGroups(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationApplicationSecurityGroups = mapped
    }

    /**
     * @param argument The application security group specified as destination.
     */
    @JvmName("knxlbwrstywkrrae")
    public suspend fun destinationApplicationSecurityGroups(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ApplicationSecurityGroupArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.destinationApplicationSecurityGroups = mapped
    }

    /**
     * @param argument The application security group specified as destination.
     */
    @JvmName("ojobfobnskhrtgbr")
    public suspend fun destinationApplicationSecurityGroups(vararg argument: suspend ApplicationSecurityGroupArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ApplicationSecurityGroupArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.destinationApplicationSecurityGroups = mapped
    }

    /**
     * @param argument The application security group specified as destination.
     */
    @JvmName("iixceaysjvvgoxjr")
    public suspend fun destinationApplicationSecurityGroups(argument: suspend ApplicationSecurityGroupArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ApplicationSecurityGroupArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.destinationApplicationSecurityGroups = mapped
    }

    /**
     * @param values The application security group specified as destination.
     */
    @JvmName("mcspfplfphhscqet")
    public suspend fun destinationApplicationSecurityGroups(vararg values: ApplicationSecurityGroupArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinationApplicationSecurityGroups = mapped
    }

    /**
     * @param value The destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
     */
    @JvmName("fmgegjotbyovpyqu")
    public suspend fun destinationPortRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationPortRange = mapped
    }

    /**
     * @param value The destination port ranges.
     */
    @JvmName("hnuldlqphivslckn")
    public suspend fun destinationPortRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationPortRanges = mapped
    }

    /**
     * @param values The destination port ranges.
     */
    @JvmName("vaehmdvtjycsfnah")
    public suspend fun destinationPortRanges(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinationPortRanges = mapped
    }

    /**
     * @param value The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
     */
    @JvmName("hvwksffixhymehqr")
    public suspend fun direction(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
     */
    @JvmName("yqaqtieyfmhykmgs")
    public fun direction(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value The direction of the rule. The direction specifies if rule will be evaluated on incoming or outgoing traffic.
     */
    @JvmName("ivgjolhqhkebiphs")
    public fun direction(`value`: SecurityRuleDirection) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value Resource ID.
     */
    @JvmName("fwvhsicthqvqmiew")
    public suspend fun id(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.id = mapped
    }

    /**
     * @param value The name of the resource that is unique within a resource group. This name can be used to access the resource.
     */
    @JvmName("klwjiucwtilajmju")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the network security group.
     */
    @JvmName("invqpvjsvpcjjiun")
    public suspend fun networkSecurityGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkSecurityGroupName = mapped
    }

    /**
     * @param value The priority of the rule. The value can be between 100 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
     */
    @JvmName("pcsbwfkrrmwiyqcb")
    public suspend fun priority(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value Network protocol this rule applies to.
     */
    @JvmName("jeogqlakpokkigmu")
    public suspend fun protocol(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value Network protocol this rule applies to.
     */
    @JvmName("lxajxexhqgmghmjo")
    public fun protocol(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value Network protocol this rule applies to.
     */
    @JvmName("yeclkuonftwdqmsh")
    public fun protocol(`value`: SecurityRuleProtocol) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value The name of the resource group.
     */
    @JvmName("cdyfonxtlmeymfjm")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The name of the security rule.
     */
    @JvmName("ilnjxlcyeuodbfwm")
    public suspend fun securityRuleName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.securityRuleName = mapped
    }

    /**
     * @param value The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
     */
    @JvmName("pxxvukqyqvhygdoo")
    public suspend fun sourceAddressPrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceAddressPrefix = mapped
    }

    /**
     * @param value The CIDR or source IP ranges.
     */
    @JvmName("stnjuquhpwymoiat")
    public suspend fun sourceAddressPrefixes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceAddressPrefixes = mapped
    }

    /**
     * @param values The CIDR or source IP ranges.
     */
    @JvmName("dysrqrhnynlvtcdr")
    public suspend fun sourceAddressPrefixes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourceAddressPrefixes = mapped
    }

    /**
     * @param value The application security group specified as source.
     */
    @JvmName("lwcjrxbeomrtiyrg")
    public suspend fun sourceApplicationSecurityGroups(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceApplicationSecurityGroups = mapped
    }

    /**
     * @param argument The application security group specified as source.
     */
    @JvmName("lerhfpnnbmfekkqw")
    public suspend fun sourceApplicationSecurityGroups(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ApplicationSecurityGroupArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.sourceApplicationSecurityGroups = mapped
    }

    /**
     * @param argument The application security group specified as source.
     */
    @JvmName("oriymdaruoiaqbbs")
    public suspend fun sourceApplicationSecurityGroups(vararg argument: suspend ApplicationSecurityGroupArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ApplicationSecurityGroupArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.sourceApplicationSecurityGroups = mapped
    }

    /**
     * @param argument The application security group specified as source.
     */
    @JvmName("xtnpnwsppaqndcir")
    public suspend fun sourceApplicationSecurityGroups(argument: suspend ApplicationSecurityGroupArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ApplicationSecurityGroupArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.sourceApplicationSecurityGroups = mapped
    }

    /**
     * @param values The application security group specified as source.
     */
    @JvmName("etbttiowbwkfkemy")
    public suspend fun sourceApplicationSecurityGroups(vararg values: ApplicationSecurityGroupArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourceApplicationSecurityGroups = mapped
    }

    /**
     * @param value The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
     */
    @JvmName("crujkyhkvimiggrs")
    public suspend fun sourcePortRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourcePortRange = mapped
    }

    /**
     * @param value The source port ranges.
     */
    @JvmName("vlwcrtnqmehphrbj")
    public suspend fun sourcePortRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourcePortRanges = mapped
    }

    /**
     * @param values The source port ranges.
     */
    @JvmName("eeaaxwfibesvnxdu")
    public suspend fun sourcePortRanges(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourcePortRanges = mapped
    }

    /**
     * @param value The type of the resource.
     */
    @JvmName("erbhajxmfhpvfwvq")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): SecurityRuleArgs = SecurityRuleArgs(
        access = access,
        description = description,
        destinationAddressPrefix = destinationAddressPrefix,
        destinationAddressPrefixes = destinationAddressPrefixes,
        destinationApplicationSecurityGroups = destinationApplicationSecurityGroups,
        destinationPortRange = destinationPortRange,
        destinationPortRanges = destinationPortRanges,
        direction = direction,
        id = id,
        name = name,
        networkSecurityGroupName = networkSecurityGroupName,
        priority = priority,
        protocol = protocol,
        resourceGroupName = resourceGroupName,
        securityRuleName = securityRuleName,
        sourceAddressPrefix = sourceAddressPrefix,
        sourceAddressPrefixes = sourceAddressPrefixes,
        sourceApplicationSecurityGroups = sourceApplicationSecurityGroups,
        sourcePortRange = sourcePortRange,
        sourcePortRanges = sourcePortRanges,
        type = type,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy