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

com.pulumi.azure.network.kotlin.NetworkSecurityRuleArgs.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.NetworkSecurityRuleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Network Security Rule.
 * > **NOTE on Network Security Groups and Network Security Rules:** This provider currently
 * provides both a standalone Network Security Rule resource, and allows for Network Security Rules to be defined in-line within the Network Security Group resource.
 * At this time you cannot use a Network Security Group with in-line Network Security Rules in conjunction with any Network Security Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("example", {
 *     name: "acceptanceTestSecurityGroup1",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleNetworkSecurityRule = new azure.network.NetworkSecurityRule("example", {
 *     name: "test123",
 *     priority: 100,
 *     direction: "Outbound",
 *     access: "Allow",
 *     protocol: "Tcp",
 *     sourcePortRange: "*",
 *     destinationPortRange: "*",
 *     sourceAddressPrefix: "*",
 *     destinationAddressPrefix: "*",
 *     resourceGroupName: example.name,
 *     networkSecurityGroupName: exampleNetworkSecurityGroup.name,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_network_security_group = azure.network.NetworkSecurityGroup("example",
 *     name="acceptanceTestSecurityGroup1",
 *     location=example.location,
 *     resource_group_name=example.name)
 * example_network_security_rule = azure.network.NetworkSecurityRule("example",
 *     name="test123",
 *     priority=100,
 *     direction="Outbound",
 *     access="Allow",
 *     protocol="Tcp",
 *     source_port_range="*",
 *     destination_port_range="*",
 *     source_address_prefix="*",
 *     destination_address_prefix="*",
 *     resource_group_name=example.name,
 *     network_security_group_name=example_network_security_group.name)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("example", new()
 *     {
 *         Name = "acceptanceTestSecurityGroup1",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleNetworkSecurityRule = new Azure.Network.NetworkSecurityRule("example", new()
 *     {
 *         Name = "test123",
 *         Priority = 100,
 *         Direction = "Outbound",
 *         Access = "Allow",
 *         Protocol = "Tcp",
 *         SourcePortRange = "*",
 *         DestinationPortRange = "*",
 *         SourceAddressPrefix = "*",
 *         DestinationAddressPrefix = "*",
 *         ResourceGroupName = example.Name,
 *         NetworkSecurityGroupName = exampleNetworkSecurityGroup.Name,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "example", &network.NetworkSecurityGroupArgs{
 * 			Name:              pulumi.String("acceptanceTestSecurityGroup1"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewNetworkSecurityRule(ctx, "example", &network.NetworkSecurityRuleArgs{
 * 			Name:                     pulumi.String("test123"),
 * 			Priority:                 pulumi.Int(100),
 * 			Direction:                pulumi.String("Outbound"),
 * 			Access:                   pulumi.String("Allow"),
 * 			Protocol:                 pulumi.String("Tcp"),
 * 			SourcePortRange:          pulumi.String("*"),
 * 			DestinationPortRange:     pulumi.String("*"),
 * 			SourceAddressPrefix:      pulumi.String("*"),
 * 			DestinationAddressPrefix: pulumi.String("*"),
 * 			ResourceGroupName:        example.Name,
 * 			NetworkSecurityGroupName: exampleNetworkSecurityGroup.Name,
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.network.NetworkSecurityGroup;
 * import com.pulumi.azure.network.NetworkSecurityGroupArgs;
 * import com.pulumi.azure.network.NetworkSecurityRule;
 * import com.pulumi.azure.network.NetworkSecurityRuleArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleNetworkSecurityGroup = new NetworkSecurityGroup("exampleNetworkSecurityGroup", NetworkSecurityGroupArgs.builder()
 *             .name("acceptanceTestSecurityGroup1")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleNetworkSecurityRule = new NetworkSecurityRule("exampleNetworkSecurityRule", NetworkSecurityRuleArgs.builder()
 *             .name("test123")
 *             .priority(100)
 *             .direction("Outbound")
 *             .access("Allow")
 *             .protocol("Tcp")
 *             .sourcePortRange("*")
 *             .destinationPortRange("*")
 *             .sourceAddressPrefix("*")
 *             .destinationAddressPrefix("*")
 *             .resourceGroupName(example.name())
 *             .networkSecurityGroupName(exampleNetworkSecurityGroup.name())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleNetworkSecurityGroup:
 *     type: azure:network:NetworkSecurityGroup
 *     name: example
 *     properties:
 *       name: acceptanceTestSecurityGroup1
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *   exampleNetworkSecurityRule:
 *     type: azure:network:NetworkSecurityRule
 *     name: example
 *     properties:
 *       name: test123
 *       priority: 100
 *       direction: Outbound
 *       access: Allow
 *       protocol: Tcp
 *       sourcePortRange: '*'
 *       destinationPortRange: '*'
 *       sourceAddressPrefix: '*'
 *       destinationAddressPrefix: '*'
 *       resourceGroupName: ${example.name}
 *       networkSecurityGroupName: ${exampleNetworkSecurityGroup.name}
 * ```
 * 
 * ## Import
 * Network Security Rules can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/networkSecurityRule:NetworkSecurityRule rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkSecurityGroups/mySecurityGroup/securityRules/rule1
 * ```
 * @property access Specifies whether network traffic is allowed or denied. Possible values are `Allow` and `Deny`.
 * @property description A description for this rule. Restricted to 140 characters.
 * @property destinationAddressPrefix CIDR or destination IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. Besides, it also supports all available Service Tags like ‘Sql.WestEurope‘, ‘Storage.EastUS‘, etc. You can list the available service tags with the CLI: ```shell az network list-service-tags --location westcentralus```. For further information please see [Azure CLI - az network list-service-tags](https://docs.microsoft.com/cli/azure/network?view=azure-cli-latest#az-network-list-service-tags). This is required if `destination_address_prefixes` is not specified.
 * @property destinationAddressPrefixes List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
 * @property destinationApplicationSecurityGroupIds A List of destination Application Security Group IDs
 * @property destinationPortRange Destination Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `destination_port_ranges` is not specified.
 * @property destinationPortRanges List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
 * @property direction The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are `Inbound` and `Outbound`.
 * @property name The name of the security rule. This needs to be unique across all Rules in the Network Security Group. Changing this forces a new resource to be created.
 * @property networkSecurityGroupName The name of the Network Security Group that we want to attach the rule to. Changing this forces a new resource to be created.
 * @property priority Specifies 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. Possible values include `Tcp`, `Udp`, `Icmp`, `Esp`, `Ah` or `*` (which matches all).
 * @property resourceGroupName The name of the resource group in which to create the Network Security Rule. Changing this forces a new resource to be created.
 * @property sourceAddressPrefix CIDR or source IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. This is required if `source_address_prefixes` is not specified.
 * @property sourceAddressPrefixes List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
 * @property sourceApplicationSecurityGroupIds A List of source Application Security Group IDs
 * @property sourcePortRange Source Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `source_port_ranges` is not specified.
 * @property sourcePortRanges List of source ports or port ranges. This is required if `source_port_range` is not specified.
 */
public data class NetworkSecurityRuleArgs(
    public val access: Output? = null,
    public val description: Output? = null,
    public val destinationAddressPrefix: Output? = null,
    public val destinationAddressPrefixes: Output>? = null,
    public val destinationApplicationSecurityGroupIds: Output? = null,
    public val destinationPortRange: Output? = null,
    public val destinationPortRanges: Output>? = null,
    public val direction: 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 sourceAddressPrefix: Output? = null,
    public val sourceAddressPrefixes: Output>? = null,
    public val sourceApplicationSecurityGroupIds: Output? = null,
    public val sourcePortRange: Output? = null,
    public val sourcePortRanges: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.NetworkSecurityRuleArgs =
        com.pulumi.azure.network.NetworkSecurityRuleArgs.builder()
            .access(access?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .destinationAddressPrefix(destinationAddressPrefix?.applyValue({ args0 -> args0 }))
            .destinationAddressPrefixes(
                destinationAddressPrefixes?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .destinationApplicationSecurityGroupIds(
                destinationApplicationSecurityGroupIds?.applyValue({ args0 ->
                    args0
                }),
            )
            .destinationPortRange(destinationPortRange?.applyValue({ args0 -> args0 }))
            .destinationPortRanges(destinationPortRanges?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .direction(direction?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .networkSecurityGroupName(networkSecurityGroupName?.applyValue({ args0 -> args0 }))
            .priority(priority?.applyValue({ args0 -> args0 }))
            .protocol(protocol?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .sourceAddressPrefix(sourceAddressPrefix?.applyValue({ args0 -> args0 }))
            .sourceAddressPrefixes(sourceAddressPrefixes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .sourceApplicationSecurityGroupIds(
                sourceApplicationSecurityGroupIds?.applyValue({ args0 ->
                    args0
                }),
            )
            .sourcePortRange(sourcePortRange?.applyValue({ args0 -> args0 }))
            .sourcePortRanges(sourcePortRanges?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

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

    private var description: Output? = null

    private var destinationAddressPrefix: Output? = null

    private var destinationAddressPrefixes: Output>? = null

    private var destinationApplicationSecurityGroupIds: Output? = null

    private var destinationPortRange: Output? = null

    private var destinationPortRanges: Output>? = null

    private var direction: 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 sourceAddressPrefix: Output? = null

    private var sourceAddressPrefixes: Output>? = null

    private var sourceApplicationSecurityGroupIds: Output? = null

    private var sourcePortRange: Output? = null

    private var sourcePortRanges: Output>? = null

    /**
     * @param value Specifies whether network traffic is allowed or denied. Possible values are `Allow` and `Deny`.
     */
    @JvmName("kvtmqjmksjelmjtq")
    public suspend fun access(`value`: Output) {
        this.access = value
    }

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

    /**
     * @param value CIDR or destination IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. Besides, it also supports all available Service Tags like ‘Sql.WestEurope‘, ‘Storage.EastUS‘, etc. You can list the available service tags with the CLI: ```shell az network list-service-tags --location westcentralus```. For further information please see [Azure CLI - az network list-service-tags](https://docs.microsoft.com/cli/azure/network?view=azure-cli-latest#az-network-list-service-tags). This is required if `destination_address_prefixes` is not specified.
     */
    @JvmName("umbftuxrvxehblus")
    public suspend fun destinationAddressPrefix(`value`: Output) {
        this.destinationAddressPrefix = value
    }

    /**
     * @param value List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
     */
    @JvmName("idrpdielwyigwjxh")
    public suspend fun destinationAddressPrefixes(`value`: Output>) {
        this.destinationAddressPrefixes = value
    }

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

    /**
     * @param values List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
     */
    @JvmName("ckbniljdqcusisob")
    public suspend fun destinationAddressPrefixes(values: List>) {
        this.destinationAddressPrefixes = Output.all(values)
    }

    /**
     * @param value A List of destination Application Security Group IDs
     */
    @JvmName("yayowgwpmwbfhhve")
    public suspend fun destinationApplicationSecurityGroupIds(`value`: Output) {
        this.destinationApplicationSecurityGroupIds = value
    }

    /**
     * @param value Destination Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `destination_port_ranges` is not specified.
     */
    @JvmName("bqbqhoawnedqhwfm")
    public suspend fun destinationPortRange(`value`: Output) {
        this.destinationPortRange = value
    }

    /**
     * @param value List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
     */
    @JvmName("svljrtccofdglxhr")
    public suspend fun destinationPortRanges(`value`: Output>) {
        this.destinationPortRanges = value
    }

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

    /**
     * @param values List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
     */
    @JvmName("tedhaqjamfrbmbwv")
    public suspend fun destinationPortRanges(values: List>) {
        this.destinationPortRanges = Output.all(values)
    }

    /**
     * @param value The direction specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are `Inbound` and `Outbound`.
     */
    @JvmName("ycffnxlcighciowc")
    public suspend fun direction(`value`: Output) {
        this.direction = value
    }

    /**
     * @param value The name of the security rule. This needs to be unique across all Rules in the Network Security Group. Changing this forces a new resource to be created.
     */
    @JvmName("jgolrdabexiweuln")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the Network Security Group that we want to attach the rule to. Changing this forces a new resource to be created.
     */
    @JvmName("petspvwuuttejsqy")
    public suspend fun networkSecurityGroupName(`value`: Output) {
        this.networkSecurityGroupName = value
    }

    /**
     * @param value Specifies 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("knwwtqccqwhcbbga")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value Network protocol this rule applies to. Possible values include `Tcp`, `Udp`, `Icmp`, `Esp`, `Ah` or `*` (which matches all).
     */
    @JvmName("hitbgadfocpbndjy")
    public suspend fun protocol(`value`: Output) {
        this.protocol = value
    }

    /**
     * @param value The name of the resource group in which to create the Network Security Rule. Changing this forces a new resource to be created.
     */
    @JvmName("iwcinkvtxraktqrv")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value CIDR or source IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. This is required if `source_address_prefixes` is not specified.
     */
    @JvmName("phnosksemarwinkf")
    public suspend fun sourceAddressPrefix(`value`: Output) {
        this.sourceAddressPrefix = value
    }

    /**
     * @param value List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
     */
    @JvmName("wmcvrahrbskoeudt")
    public suspend fun sourceAddressPrefixes(`value`: Output>) {
        this.sourceAddressPrefixes = value
    }

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

    /**
     * @param values List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
     */
    @JvmName("kophuhhwkvtddawk")
    public suspend fun sourceAddressPrefixes(values: List>) {
        this.sourceAddressPrefixes = Output.all(values)
    }

    /**
     * @param value A List of source Application Security Group IDs
     */
    @JvmName("uivlxdjhphsvftcy")
    public suspend fun sourceApplicationSecurityGroupIds(`value`: Output) {
        this.sourceApplicationSecurityGroupIds = value
    }

    /**
     * @param value Source Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `source_port_ranges` is not specified.
     */
    @JvmName("djgpaqbotieujtux")
    public suspend fun sourcePortRange(`value`: Output) {
        this.sourcePortRange = value
    }

    /**
     * @param value List of source ports or port ranges. This is required if `source_port_range` is not specified.
     */
    @JvmName("ppexqqovfqfyehus")
    public suspend fun sourcePortRanges(`value`: Output>) {
        this.sourcePortRanges = value
    }

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

    /**
     * @param values List of source ports or port ranges. This is required if `source_port_range` is not specified.
     */
    @JvmName("jaqqhyghcyugcvot")
    public suspend fun sourcePortRanges(values: List>) {
        this.sourcePortRanges = Output.all(values)
    }

    /**
     * @param value Specifies whether network traffic is allowed or denied. Possible values are `Allow` and `Deny`.
     */
    @JvmName("rpanwosieqejjlgr")
    public suspend fun access(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.access = mapped
    }

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

    /**
     * @param value CIDR or destination IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. Besides, it also supports all available Service Tags like ‘Sql.WestEurope‘, ‘Storage.EastUS‘, etc. You can list the available service tags with the CLI: ```shell az network list-service-tags --location westcentralus```. For further information please see [Azure CLI - az network list-service-tags](https://docs.microsoft.com/cli/azure/network?view=azure-cli-latest#az-network-list-service-tags). This is required if `destination_address_prefixes` is not specified.
     */
    @JvmName("dkkkrhiwrueeccwi")
    public suspend fun destinationAddressPrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationAddressPrefix = mapped
    }

    /**
     * @param value List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
     */
    @JvmName("bjwovmuixxjstjrv")
    public suspend fun destinationAddressPrefixes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationAddressPrefixes = mapped
    }

    /**
     * @param values List of destination address prefixes. Tags may not be used. This is required if `destination_address_prefix` is not specified.
     */
    @JvmName("ruvnkqmrelpcbmbb")
    public suspend fun destinationAddressPrefixes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinationAddressPrefixes = mapped
    }

    /**
     * @param value A List of destination Application Security Group IDs
     */
    @JvmName("baxtlyatbclxsjgo")
    public suspend fun destinationApplicationSecurityGroupIds(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationApplicationSecurityGroupIds = mapped
    }

    /**
     * @param value Destination Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `destination_port_ranges` is not specified.
     */
    @JvmName("eqlhgrtgifhnptvp")
    public suspend fun destinationPortRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationPortRange = mapped
    }

    /**
     * @param value List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
     */
    @JvmName("ylpobvmosmngrtsq")
    public suspend fun destinationPortRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationPortRanges = mapped
    }

    /**
     * @param values List of destination ports or port ranges. This is required if `destination_port_range` is not specified.
     */
    @JvmName("idsppjuinshqypxf")
    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 specifies if rule will be evaluated on incoming or outgoing traffic. Possible values are `Inbound` and `Outbound`.
     */
    @JvmName("owsinfjwtyhtyxbl")
    public suspend fun direction(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value The name of the security rule. This needs to be unique across all Rules in the Network Security Group. Changing this forces a new resource to be created.
     */
    @JvmName("barmsjlmnhwtjspn")
    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 that we want to attach the rule to. Changing this forces a new resource to be created.
     */
    @JvmName("nyqhgcdrapxdidik")
    public suspend fun networkSecurityGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkSecurityGroupName = mapped
    }

    /**
     * @param value Specifies 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("wagimpqqkdtlunro")
    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. Possible values include `Tcp`, `Udp`, `Icmp`, `Esp`, `Ah` or `*` (which matches all).
     */
    @JvmName("hptbgwijgilvtbtf")
    public suspend fun protocol(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value The name of the resource group in which to create the Network Security Rule. Changing this forces a new resource to be created.
     */
    @JvmName("taewgtgsxdxiemdt")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value CIDR or source IP range or * to match any IP. Tags such as `VirtualNetwork`, `AzureLoadBalancer` and `Internet` can also be used. This is required if `source_address_prefixes` is not specified.
     */
    @JvmName("uikubbuvjbmqdanl")
    public suspend fun sourceAddressPrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceAddressPrefix = mapped
    }

    /**
     * @param value List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
     */
    @JvmName("nhwamyidhrtcqujy")
    public suspend fun sourceAddressPrefixes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceAddressPrefixes = mapped
    }

    /**
     * @param values List of source address prefixes. Tags may not be used. This is required if `source_address_prefix` is not specified.
     */
    @JvmName("capqjfdcgtfetpct")
    public suspend fun sourceAddressPrefixes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourceAddressPrefixes = mapped
    }

    /**
     * @param value A List of source Application Security Group IDs
     */
    @JvmName("vxtdeucuxombgypj")
    public suspend fun sourceApplicationSecurityGroupIds(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceApplicationSecurityGroupIds = mapped
    }

    /**
     * @param value Source Port or Range. Integer or range between `0` and `65535` or `*` to match any. This is required if `source_port_ranges` is not specified.
     */
    @JvmName("ndalghvrbvrlrjsl")
    public suspend fun sourcePortRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourcePortRange = mapped
    }

    /**
     * @param value List of source ports or port ranges. This is required if `source_port_range` is not specified.
     */
    @JvmName("lsinejsdrwvkudpx")
    public suspend fun sourcePortRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourcePortRanges = mapped
    }

    /**
     * @param values List of source ports or port ranges. This is required if `source_port_range` is not specified.
     */
    @JvmName("tsaxaoyedeojkvsu")
    public suspend fun sourcePortRanges(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourcePortRanges = mapped
    }

    internal fun build(): NetworkSecurityRuleArgs = NetworkSecurityRuleArgs(
        access = access,
        description = description,
        destinationAddressPrefix = destinationAddressPrefix,
        destinationAddressPrefixes = destinationAddressPrefixes,
        destinationApplicationSecurityGroupIds = destinationApplicationSecurityGroupIds,
        destinationPortRange = destinationPortRange,
        destinationPortRanges = destinationPortRanges,
        direction = direction,
        name = name,
        networkSecurityGroupName = networkSecurityGroupName,
        priority = priority,
        protocol = protocol,
        resourceGroupName = resourceGroupName,
        sourceAddressPrefix = sourceAddressPrefix,
        sourceAddressPrefixes = sourceAddressPrefixes,
        sourceApplicationSecurityGroupIds = sourceApplicationSecurityGroupIds,
        sourcePortRange = sourcePortRange,
        sourcePortRanges = sourcePortRanges,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy