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

com.pulumi.azure.network.kotlin.NetworkManagerAdminRuleArgs.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.NetworkManagerAdminRuleArgs.builder
import com.pulumi.azure.network.kotlin.inputs.NetworkManagerAdminRuleDestinationArgs
import com.pulumi.azure.network.kotlin.inputs.NetworkManagerAdminRuleDestinationArgsBuilder
import com.pulumi.azure.network.kotlin.inputs.NetworkManagerAdminRuleSourceArgs
import com.pulumi.azure.network.kotlin.inputs.NetworkManagerAdminRuleSourceArgsBuilder
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

/**
 * Manages a Network Manager Admin Rule.
 * ## 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 current = azure.core.getSubscription({});
 * const exampleNetworkManager = new azure.network.NetworkManager("example", {
 *     name: "example-network-manager",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     scope: {
 *         subscriptionIds: [current.then(current => current.id)],
 *     },
 *     scopeAccesses: [
 *         "Connectivity",
 *         "SecurityAdmin",
 *     ],
 *     description: "example network manager",
 * });
 * const exampleNetworkManagerNetworkGroup = new azure.network.NetworkManagerNetworkGroup("example", {
 *     name: "example-network-group",
 *     networkManagerId: exampleNetworkManager.id,
 * });
 * const exampleNetworkManagerSecurityAdminConfiguration = new azure.network.NetworkManagerSecurityAdminConfiguration("example", {
 *     name: "example-admin-conf",
 *     networkManagerId: exampleNetworkManager.id,
 * });
 * const exampleNetworkManagerAdminRuleCollection = new azure.network.NetworkManagerAdminRuleCollection("example", {
 *     name: "example-admin-rule-collection",
 *     securityAdminConfigurationId: exampleNetworkManagerSecurityAdminConfiguration.id,
 *     networkGroupIds: [exampleNetworkManagerNetworkGroup.id],
 * });
 * const exampleNetworkManagerAdminRule = new azure.network.NetworkManagerAdminRule("example", {
 *     name: "example-admin-rule",
 *     adminRuleCollectionId: exampleNetworkManagerAdminRuleCollection.id,
 *     action: "Deny",
 *     direction: "Outbound",
 *     priority: 1,
 *     protocol: "Tcp",
 *     sourcePortRanges: [
 *         "80",
 *         "1024-65535",
 *     ],
 *     destinationPortRanges: ["80"],
 *     sources: [{
 *         addressPrefixType: "ServiceTag",
 *         addressPrefix: "Internet",
 *     }],
 *     destinations: [
 *         {
 *             addressPrefixType: "IPPrefix",
 *             addressPrefix: "10.1.0.1",
 *         },
 *         {
 *             addressPrefixType: "IPPrefix",
 *             addressPrefix: "10.0.0.0/24",
 *         },
 *     ],
 *     description: "example admin rule",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * current = azure.core.get_subscription()
 * example_network_manager = azure.network.NetworkManager("example",
 *     name="example-network-manager",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     scope=azure.network.NetworkManagerScopeArgs(
 *         subscription_ids=[current.id],
 *     ),
 *     scope_accesses=[
 *         "Connectivity",
 *         "SecurityAdmin",
 *     ],
 *     description="example network manager")
 * example_network_manager_network_group = azure.network.NetworkManagerNetworkGroup("example",
 *     name="example-network-group",
 *     network_manager_id=example_network_manager.id)
 * example_network_manager_security_admin_configuration = azure.network.NetworkManagerSecurityAdminConfiguration("example",
 *     name="example-admin-conf",
 *     network_manager_id=example_network_manager.id)
 * example_network_manager_admin_rule_collection = azure.network.NetworkManagerAdminRuleCollection("example",
 *     name="example-admin-rule-collection",
 *     security_admin_configuration_id=example_network_manager_security_admin_configuration.id,
 *     network_group_ids=[example_network_manager_network_group.id])
 * example_network_manager_admin_rule = azure.network.NetworkManagerAdminRule("example",
 *     name="example-admin-rule",
 *     admin_rule_collection_id=example_network_manager_admin_rule_collection.id,
 *     action="Deny",
 *     direction="Outbound",
 *     priority=1,
 *     protocol="Tcp",
 *     source_port_ranges=[
 *         "80",
 *         "1024-65535",
 *     ],
 *     destination_port_ranges=["80"],
 *     sources=[azure.network.NetworkManagerAdminRuleSourceArgs(
 *         address_prefix_type="ServiceTag",
 *         address_prefix="Internet",
 *     )],
 *     destinations=[
 *         azure.network.NetworkManagerAdminRuleDestinationArgs(
 *             address_prefix_type="IPPrefix",
 *             address_prefix="10.1.0.1",
 *         ),
 *         azure.network.NetworkManagerAdminRuleDestinationArgs(
 *             address_prefix_type="IPPrefix",
 *             address_prefix="10.0.0.0/24",
 *         ),
 *     ],
 *     description="example admin rule")
 * ```
 * ```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 current = Azure.Core.GetSubscription.Invoke();
 *     var exampleNetworkManager = new Azure.Network.NetworkManager("example", new()
 *     {
 *         Name = "example-network-manager",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Scope = new Azure.Network.Inputs.NetworkManagerScopeArgs
 *         {
 *             SubscriptionIds = new[]
 *             {
 *                 current.Apply(getSubscriptionResult => getSubscriptionResult.Id),
 *             },
 *         },
 *         ScopeAccesses = new[]
 *         {
 *             "Connectivity",
 *             "SecurityAdmin",
 *         },
 *         Description = "example network manager",
 *     });
 *     var exampleNetworkManagerNetworkGroup = new Azure.Network.NetworkManagerNetworkGroup("example", new()
 *     {
 *         Name = "example-network-group",
 *         NetworkManagerId = exampleNetworkManager.Id,
 *     });
 *     var exampleNetworkManagerSecurityAdminConfiguration = new Azure.Network.NetworkManagerSecurityAdminConfiguration("example", new()
 *     {
 *         Name = "example-admin-conf",
 *         NetworkManagerId = exampleNetworkManager.Id,
 *     });
 *     var exampleNetworkManagerAdminRuleCollection = new Azure.Network.NetworkManagerAdminRuleCollection("example", new()
 *     {
 *         Name = "example-admin-rule-collection",
 *         SecurityAdminConfigurationId = exampleNetworkManagerSecurityAdminConfiguration.Id,
 *         NetworkGroupIds = new[]
 *         {
 *             exampleNetworkManagerNetworkGroup.Id,
 *         },
 *     });
 *     var exampleNetworkManagerAdminRule = new Azure.Network.NetworkManagerAdminRule("example", new()
 *     {
 *         Name = "example-admin-rule",
 *         AdminRuleCollectionId = exampleNetworkManagerAdminRuleCollection.Id,
 *         Action = "Deny",
 *         Direction = "Outbound",
 *         Priority = 1,
 *         Protocol = "Tcp",
 *         SourcePortRanges = new[]
 *         {
 *             "80",
 *             "1024-65535",
 *         },
 *         DestinationPortRanges = new[]
 *         {
 *             "80",
 *         },
 *         Sources = new[]
 *         {
 *             new Azure.Network.Inputs.NetworkManagerAdminRuleSourceArgs
 *             {
 *                 AddressPrefixType = "ServiceTag",
 *                 AddressPrefix = "Internet",
 *             },
 *         },
 *         Destinations = new[]
 *         {
 *             new Azure.Network.Inputs.NetworkManagerAdminRuleDestinationArgs
 *             {
 *                 AddressPrefixType = "IPPrefix",
 *                 AddressPrefix = "10.1.0.1",
 *             },
 *             new Azure.Network.Inputs.NetworkManagerAdminRuleDestinationArgs
 *             {
 *                 AddressPrefixType = "IPPrefix",
 *                 AddressPrefix = "10.0.0.0/24",
 *             },
 *         },
 *         Description = "example admin rule",
 *     });
 * });
 * ```
 * ```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
 * 		}
 * 		current, err := core.LookupSubscription(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkManager, err := network.NewNetworkManager(ctx, "example", &network.NetworkManagerArgs{
 * 			Name:              pulumi.String("example-network-manager"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Scope: &network.NetworkManagerScopeArgs{
 * 				SubscriptionIds: pulumi.StringArray{
 * 					pulumi.String(current.Id),
 * 				},
 * 			},
 * 			ScopeAccesses: pulumi.StringArray{
 * 				pulumi.String("Connectivity"),
 * 				pulumi.String("SecurityAdmin"),
 * 			},
 * 			Description: pulumi.String("example network manager"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkManagerNetworkGroup, err := network.NewNetworkManagerNetworkGroup(ctx, "example", &network.NetworkManagerNetworkGroupArgs{
 * 			Name:             pulumi.String("example-network-group"),
 * 			NetworkManagerId: exampleNetworkManager.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkManagerSecurityAdminConfiguration, err := network.NewNetworkManagerSecurityAdminConfiguration(ctx, "example", &network.NetworkManagerSecurityAdminConfigurationArgs{
 * 			Name:             pulumi.String("example-admin-conf"),
 * 			NetworkManagerId: exampleNetworkManager.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleNetworkManagerAdminRuleCollection, err := network.NewNetworkManagerAdminRuleCollection(ctx, "example", &network.NetworkManagerAdminRuleCollectionArgs{
 * 			Name:                         pulumi.String("example-admin-rule-collection"),
 * 			SecurityAdminConfigurationId: exampleNetworkManagerSecurityAdminConfiguration.ID(),
 * 			NetworkGroupIds: pulumi.StringArray{
 * 				exampleNetworkManagerNetworkGroup.ID(),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = network.NewNetworkManagerAdminRule(ctx, "example", &network.NetworkManagerAdminRuleArgs{
 * 			Name:                  pulumi.String("example-admin-rule"),
 * 			AdminRuleCollectionId: exampleNetworkManagerAdminRuleCollection.ID(),
 * 			Action:                pulumi.String("Deny"),
 * 			Direction:             pulumi.String("Outbound"),
 * 			Priority:              pulumi.Int(1),
 * 			Protocol:              pulumi.String("Tcp"),
 * 			SourcePortRanges: pulumi.StringArray{
 * 				pulumi.String("80"),
 * 				pulumi.String("1024-65535"),
 * 			},
 * 			DestinationPortRanges: pulumi.StringArray{
 * 				pulumi.String("80"),
 * 			},
 * 			Sources: network.NetworkManagerAdminRuleSourceArray{
 * 				&network.NetworkManagerAdminRuleSourceArgs{
 * 					AddressPrefixType: pulumi.String("ServiceTag"),
 * 					AddressPrefix:     pulumi.String("Internet"),
 * 				},
 * 			},
 * 			Destinations: network.NetworkManagerAdminRuleDestinationArray{
 * 				&network.NetworkManagerAdminRuleDestinationArgs{
 * 					AddressPrefixType: pulumi.String("IPPrefix"),
 * 					AddressPrefix:     pulumi.String("10.1.0.1"),
 * 				},
 * 				&network.NetworkManagerAdminRuleDestinationArgs{
 * 					AddressPrefixType: pulumi.String("IPPrefix"),
 * 					AddressPrefix:     pulumi.String("10.0.0.0/24"),
 * 				},
 * 			},
 * 			Description: pulumi.String("example admin rule"),
 * 		})
 * 		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.core.CoreFunctions;
 * import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
 * import com.pulumi.azure.network.NetworkManager;
 * import com.pulumi.azure.network.NetworkManagerArgs;
 * import com.pulumi.azure.network.inputs.NetworkManagerScopeArgs;
 * import com.pulumi.azure.network.NetworkManagerNetworkGroup;
 * import com.pulumi.azure.network.NetworkManagerNetworkGroupArgs;
 * import com.pulumi.azure.network.NetworkManagerSecurityAdminConfiguration;
 * import com.pulumi.azure.network.NetworkManagerSecurityAdminConfigurationArgs;
 * import com.pulumi.azure.network.NetworkManagerAdminRuleCollection;
 * import com.pulumi.azure.network.NetworkManagerAdminRuleCollectionArgs;
 * import com.pulumi.azure.network.NetworkManagerAdminRule;
 * import com.pulumi.azure.network.NetworkManagerAdminRuleArgs;
 * import com.pulumi.azure.network.inputs.NetworkManagerAdminRuleSourceArgs;
 * import com.pulumi.azure.network.inputs.NetworkManagerAdminRuleDestinationArgs;
 * 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());
 *         final var current = CoreFunctions.getSubscription();
 *         var exampleNetworkManager = new NetworkManager("exampleNetworkManager", NetworkManagerArgs.builder()
 *             .name("example-network-manager")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .scope(NetworkManagerScopeArgs.builder()
 *                 .subscriptionIds(current.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
 *                 .build())
 *             .scopeAccesses(
 *                 "Connectivity",
 *                 "SecurityAdmin")
 *             .description("example network manager")
 *             .build());
 *         var exampleNetworkManagerNetworkGroup = new NetworkManagerNetworkGroup("exampleNetworkManagerNetworkGroup", NetworkManagerNetworkGroupArgs.builder()
 *             .name("example-network-group")
 *             .networkManagerId(exampleNetworkManager.id())
 *             .build());
 *         var exampleNetworkManagerSecurityAdminConfiguration = new NetworkManagerSecurityAdminConfiguration("exampleNetworkManagerSecurityAdminConfiguration", NetworkManagerSecurityAdminConfigurationArgs.builder()
 *             .name("example-admin-conf")
 *             .networkManagerId(exampleNetworkManager.id())
 *             .build());
 *         var exampleNetworkManagerAdminRuleCollection = new NetworkManagerAdminRuleCollection("exampleNetworkManagerAdminRuleCollection", NetworkManagerAdminRuleCollectionArgs.builder()
 *             .name("example-admin-rule-collection")
 *             .securityAdminConfigurationId(exampleNetworkManagerSecurityAdminConfiguration.id())
 *             .networkGroupIds(exampleNetworkManagerNetworkGroup.id())
 *             .build());
 *         var exampleNetworkManagerAdminRule = new NetworkManagerAdminRule("exampleNetworkManagerAdminRule", NetworkManagerAdminRuleArgs.builder()
 *             .name("example-admin-rule")
 *             .adminRuleCollectionId(exampleNetworkManagerAdminRuleCollection.id())
 *             .action("Deny")
 *             .direction("Outbound")
 *             .priority(1)
 *             .protocol("Tcp")
 *             .sourcePortRanges(
 *                 "80",
 *                 "1024-65535")
 *             .destinationPortRanges("80")
 *             .sources(NetworkManagerAdminRuleSourceArgs.builder()
 *                 .addressPrefixType("ServiceTag")
 *                 .addressPrefix("Internet")
 *                 .build())
 *             .destinations(
 *                 NetworkManagerAdminRuleDestinationArgs.builder()
 *                     .addressPrefixType("IPPrefix")
 *                     .addressPrefix("10.1.0.1")
 *                     .build(),
 *                 NetworkManagerAdminRuleDestinationArgs.builder()
 *                     .addressPrefixType("IPPrefix")
 *                     .addressPrefix("10.0.0.0/24")
 *                     .build())
 *             .description("example admin rule")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleNetworkManager:
 *     type: azure:network:NetworkManager
 *     name: example
 *     properties:
 *       name: example-network-manager
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       scope:
 *         subscriptionIds:
 *           - ${current.id}
 *       scopeAccesses:
 *         - Connectivity
 *         - SecurityAdmin
 *       description: example network manager
 *   exampleNetworkManagerNetworkGroup:
 *     type: azure:network:NetworkManagerNetworkGroup
 *     name: example
 *     properties:
 *       name: example-network-group
 *       networkManagerId: ${exampleNetworkManager.id}
 *   exampleNetworkManagerSecurityAdminConfiguration:
 *     type: azure:network:NetworkManagerSecurityAdminConfiguration
 *     name: example
 *     properties:
 *       name: example-admin-conf
 *       networkManagerId: ${exampleNetworkManager.id}
 *   exampleNetworkManagerAdminRuleCollection:
 *     type: azure:network:NetworkManagerAdminRuleCollection
 *     name: example
 *     properties:
 *       name: example-admin-rule-collection
 *       securityAdminConfigurationId: ${exampleNetworkManagerSecurityAdminConfiguration.id}
 *       networkGroupIds:
 *         - ${exampleNetworkManagerNetworkGroup.id}
 *   exampleNetworkManagerAdminRule:
 *     type: azure:network:NetworkManagerAdminRule
 *     name: example
 *     properties:
 *       name: example-admin-rule
 *       adminRuleCollectionId: ${exampleNetworkManagerAdminRuleCollection.id}
 *       action: Deny
 *       direction: Outbound
 *       priority: 1
 *       protocol: Tcp
 *       sourcePortRanges:
 *         - '80'
 *         - 1024-65535
 *       destinationPortRanges:
 *         - '80'
 *       sources:
 *         - addressPrefixType: ServiceTag
 *           addressPrefix: Internet
 *       destinations:
 *         - addressPrefixType: IPPrefix
 *           addressPrefix: 10.1.0.1
 *         - addressPrefixType: IPPrefix
 *           addressPrefix: 10.0.0.0/24
 *       description: example admin rule
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getSubscription
 *       Arguments: {}
 * ```
 * 
 * ## Import
 * Network Manager Admin Rule can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:network/networkManagerAdminRule:NetworkManagerAdminRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Network/networkManagers/networkManager1/securityAdminConfigurations/configuration1/ruleCollections/ruleCollection1/rules/rule1
 * ```
 * @property action Specifies the action allowed for this Network Manager Admin Rule. Possible values are `Allow`, `AlwaysAllow`, and `Deny`.
 * @property adminRuleCollectionId Specifies the ID of the Network Manager Admin Rule Collection. Changing this forces a new Network Manager Admin Rule to be created.
 * @property description A description of the Network Manager Admin Rule.
 * @property destinationPortRanges A list of string specifies the destination port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
 * @property destinations One or more `destination` blocks as defined below.
 * @property direction Indicates if the traffic matched against the rule in inbound or outbound. Possible values are `Inbound` and `Outbound`.
 * @property name Specifies the name which should be used for this Network Manager Admin Rule. Changing this forces a new Network Manager Admin Rule to be created.
 * @property priority The priority of the rule. Possible values are integers between `1` 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 Specifies which network protocol this Network Manager Admin Rule applies to. Possible values are `Ah`, `Any`, `Esp`, `Icmp`, `Tcp`, and `Udp`.
 * @property sourcePortRanges A list of string specifies the source port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
 * @property sources One or more `source` blocks as defined below.
 */
public data class NetworkManagerAdminRuleArgs(
    public val action: Output? = null,
    public val adminRuleCollectionId: Output? = null,
    public val description: Output? = null,
    public val destinationPortRanges: Output>? = null,
    public val destinations: Output>? = null,
    public val direction: Output? = null,
    public val name: Output? = null,
    public val priority: Output? = null,
    public val protocol: Output? = null,
    public val sourcePortRanges: Output>? = null,
    public val sources: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.network.NetworkManagerAdminRuleArgs =
        com.pulumi.azure.network.NetworkManagerAdminRuleArgs.builder()
            .action(action?.applyValue({ args0 -> args0 }))
            .adminRuleCollectionId(adminRuleCollectionId?.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 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .priority(priority?.applyValue({ args0 -> args0 }))
            .protocol(protocol?.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 [NetworkManagerAdminRuleArgs].
 */
@PulumiTagMarker
public class NetworkManagerAdminRuleArgsBuilder internal constructor() {
    private var action: Output? = null

    private var adminRuleCollectionId: Output? = null

    private var description: Output? = null

    private var destinationPortRanges: Output>? = null

    private var destinations: Output>? = null

    private var direction: Output? = null

    private var name: Output? = null

    private var priority: Output? = null

    private var protocol: Output? = null

    private var sourcePortRanges: Output>? = null

    private var sources: Output>? = null

    /**
     * @param value Specifies the action allowed for this Network Manager Admin Rule. Possible values are `Allow`, `AlwaysAllow`, and `Deny`.
     */
    @JvmName("ytppudjwkhlojbcs")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value Specifies the ID of the Network Manager Admin Rule Collection. Changing this forces a new Network Manager Admin Rule to be created.
     */
    @JvmName("uewkiewavpcaqend")
    public suspend fun adminRuleCollectionId(`value`: Output) {
        this.adminRuleCollectionId = value
    }

    /**
     * @param value A description of the Network Manager Admin Rule.
     */
    @JvmName("wyysabsmvdtykyyc")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value A list of string specifies the destination port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
     */
    @JvmName("cmmhfnnahepthpbj")
    public suspend fun destinationPortRanges(`value`: Output>) {
        this.destinationPortRanges = value
    }

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

    /**
     * @param values A list of string specifies the destination port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
     */
    @JvmName("selnidbfpumaerkv")
    public suspend fun destinationPortRanges(values: List>) {
        this.destinationPortRanges = Output.all(values)
    }

    /**
     * @param value One or more `destination` blocks as defined below.
     */
    @JvmName("nidolvtywbmlbrdx")
    public suspend fun destinations(`value`: Output>) {
        this.destinations = value
    }

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

    /**
     * @param values One or more `destination` blocks as defined below.
     */
    @JvmName("tbwbncwlydntijpk")
    public suspend fun destinations(values: List>) {
        this.destinations = Output.all(values)
    }

    /**
     * @param value Indicates if the traffic matched against the rule in inbound or outbound. Possible values are `Inbound` and `Outbound`.
     */
    @JvmName("scopaufexofrsxsw")
    public suspend fun direction(`value`: Output) {
        this.direction = value
    }

    /**
     * @param value Specifies the name which should be used for this Network Manager Admin Rule. Changing this forces a new Network Manager Admin Rule to be created.
     */
    @JvmName("mqlatbeqlonrtpgq")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The priority of the rule. Possible values are integers between `1` 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("bscgguhtwwgvtgsp")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value Specifies which network protocol this Network Manager Admin Rule applies to. Possible values are `Ah`, `Any`, `Esp`, `Icmp`, `Tcp`, and `Udp`.
     */
    @JvmName("lhhtxhwsyunthigj")
    public suspend fun protocol(`value`: Output) {
        this.protocol = value
    }

    /**
     * @param value A list of string specifies the source port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
     */
    @JvmName("tsiyplubvigpemdy")
    public suspend fun sourcePortRanges(`value`: Output>) {
        this.sourcePortRanges = value
    }

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

    /**
     * @param values A list of string specifies the source port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
     */
    @JvmName("gkapstojiedawlbj")
    public suspend fun sourcePortRanges(values: List>) {
        this.sourcePortRanges = Output.all(values)
    }

    /**
     * @param value One or more `source` blocks as defined below.
     */
    @JvmName("ecjpgvcojfxqtftp")
    public suspend fun sources(`value`: Output>) {
        this.sources = value
    }

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

    /**
     * @param values One or more `source` blocks as defined below.
     */
    @JvmName("credyvkotalxjolk")
    public suspend fun sources(values: List>) {
        this.sources = Output.all(values)
    }

    /**
     * @param value Specifies the action allowed for this Network Manager Admin Rule. Possible values are `Allow`, `AlwaysAllow`, and `Deny`.
     */
    @JvmName("hpfybmiqracouhit")
    public suspend fun action(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param value Specifies the ID of the Network Manager Admin Rule Collection. Changing this forces a new Network Manager Admin Rule to be created.
     */
    @JvmName("bsklxlogmnrmmite")
    public suspend fun adminRuleCollectionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.adminRuleCollectionId = mapped
    }

    /**
     * @param value A description of the Network Manager Admin Rule.
     */
    @JvmName("sjqtmxetixjfuxdx")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value A list of string specifies the destination port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
     */
    @JvmName("xglyxccapcvawseq")
    public suspend fun destinationPortRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinationPortRanges = mapped
    }

    /**
     * @param values A list of string specifies the destination port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
     */
    @JvmName("vatohpwaeqwjbitj")
    public suspend fun destinationPortRanges(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinationPortRanges = mapped
    }

    /**
     * @param value One or more `destination` blocks as defined below.
     */
    @JvmName("wosawlnfuwoyeyit")
    public suspend fun destinations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.destinations = mapped
    }

    /**
     * @param argument One or more `destination` blocks as defined below.
     */
    @JvmName("eshdyhtyrntnonii")
    public suspend
    fun destinations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NetworkManagerAdminRuleDestinationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.destinations = mapped
    }

    /**
     * @param argument One or more `destination` blocks as defined below.
     */
    @JvmName("bofpkpqtjnhuxigm")
    public suspend fun destinations(
        vararg
        argument: suspend NetworkManagerAdminRuleDestinationArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            NetworkManagerAdminRuleDestinationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.destinations = mapped
    }

    /**
     * @param argument One or more `destination` blocks as defined below.
     */
    @JvmName("ptqspsjghgmcdoak")
    public suspend
    fun destinations(argument: suspend NetworkManagerAdminRuleDestinationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            NetworkManagerAdminRuleDestinationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.destinations = mapped
    }

    /**
     * @param values One or more `destination` blocks as defined below.
     */
    @JvmName("qakpiaxdbfgjprtm")
    public suspend fun destinations(vararg values: NetworkManagerAdminRuleDestinationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinations = mapped
    }

    /**
     * @param value Indicates if the traffic matched against the rule in inbound or outbound. Possible values are `Inbound` and `Outbound`.
     */
    @JvmName("scusqnlpfqnimbpg")
    public suspend fun direction(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value Specifies the name which should be used for this Network Manager Admin Rule. Changing this forces a new Network Manager Admin Rule to be created.
     */
    @JvmName("kkwxonxksgvfyeqt")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The priority of the rule. Possible values are integers between `1` 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("ftnsenfruxskioqs")
    public suspend fun priority(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value Specifies which network protocol this Network Manager Admin Rule applies to. Possible values are `Ah`, `Any`, `Esp`, `Icmp`, `Tcp`, and `Udp`.
     */
    @JvmName("gwfuothvksocvivc")
    public suspend fun protocol(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value A list of string specifies the source port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
     */
    @JvmName("dncebxsbavyljsoj")
    public suspend fun sourcePortRanges(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourcePortRanges = mapped
    }

    /**
     * @param values A list of string specifies the source port ranges. Specify one or more single port number or port ranges such as `1024-65535`. Use `*` to specify any port.
     */
    @JvmName("ngaewlmjejpyycsr")
    public suspend fun sourcePortRanges(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sourcePortRanges = mapped
    }

    /**
     * @param value One or more `source` blocks as defined below.
     */
    @JvmName("kuxgknufmtfitgyu")
    public suspend fun sources(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sources = mapped
    }

    /**
     * @param argument One or more `source` blocks as defined below.
     */
    @JvmName("yhdjgsijdinqlmsu")
    public suspend
    fun sources(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NetworkManagerAdminRuleSourceArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.sources = mapped
    }

    /**
     * @param argument One or more `source` blocks as defined below.
     */
    @JvmName("cgfkbpwcutunckdq")
    public suspend fun sources(
        vararg
        argument: suspend NetworkManagerAdminRuleSourceArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            NetworkManagerAdminRuleSourceArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.sources = mapped
    }

    /**
     * @param argument One or more `source` blocks as defined below.
     */
    @JvmName("eewyjkekehmbnsls")
    public suspend
    fun sources(argument: suspend NetworkManagerAdminRuleSourceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            NetworkManagerAdminRuleSourceArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.sources = mapped
    }

    /**
     * @param values One or more `source` blocks as defined below.
     */
    @JvmName("lvfidjsqgevfgnjf")
    public suspend fun sources(vararg values: NetworkManagerAdminRuleSourceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sources = mapped
    }

    internal fun build(): NetworkManagerAdminRuleArgs = NetworkManagerAdminRuleArgs(
        action = action,
        adminRuleCollectionId = adminRuleCollectionId,
        description = description,
        destinationPortRanges = destinationPortRanges,
        destinations = destinations,
        direction = direction,
        name = name,
        priority = priority,
        protocol = protocol,
        sourcePortRanges = sourcePortRanges,
        sources = sources,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy