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

com.pulumi.azurenative.network.kotlin.UserRuleCollectionArgs.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.UserRuleCollectionArgs.builder
import com.pulumi.azurenative.network.kotlin.inputs.NetworkManagerSecurityGroupItemArgs
import com.pulumi.azurenative.network.kotlin.inputs.NetworkManagerSecurityGroupItemArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Defines the user rule collection.
 * Azure REST API version: 2022-04-01-preview. Prior API version in Azure Native 1.x: 2021-02-01-preview.
 * Other available API versions: 2021-02-01-preview, 2021-05-01-preview.
 * ## Example Usage
 * ### Create or Update a User Rule Collection
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var userRuleCollection = new AzureNative.Network.UserRuleCollection("userRuleCollection", new()
 *     {
 *         AppliesToGroups = new[]
 *         {
 *             new AzureNative.Network.Inputs.NetworkManagerSecurityGroupItemArgs
 *             {
 *                 NetworkGroupId = "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup",
 *             },
 *         },
 *         ConfigurationName = "myTestSecurityConfig",
 *         Description = "A sample policy",
 *         NetworkManagerName = "testNetworkManager",
 *         ResourceGroupName = "rg1",
 *         RuleCollectionName = "testRuleCollection",
 *     });
 * });
 * ```
 * ```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.NewUserRuleCollection(ctx, "userRuleCollection", &network.UserRuleCollectionArgs{
 * 			AppliesToGroups: network.NetworkManagerSecurityGroupItemArray{
 * 				&network.NetworkManagerSecurityGroupItemArgs{
 * 					NetworkGroupId: pulumi.String("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup"),
 * 				},
 * 			},
 * 			ConfigurationName:  pulumi.String("myTestSecurityConfig"),
 * 			Description:        pulumi.String("A sample policy"),
 * 			NetworkManagerName: pulumi.String("testNetworkManager"),
 * 			ResourceGroupName:  pulumi.String("rg1"),
 * 			RuleCollectionName: pulumi.String("testRuleCollection"),
 * 		})
 * 		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.UserRuleCollection;
 * import com.pulumi.azurenative.network.UserRuleCollectionArgs;
 * import com.pulumi.azurenative.network.inputs.NetworkManagerSecurityGroupItemArgs;
 * 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 userRuleCollection = new UserRuleCollection("userRuleCollection", UserRuleCollectionArgs.builder()
 *             .appliesToGroups(NetworkManagerSecurityGroupItemArgs.builder()
 *                 .networkGroupId("/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/testGroup")
 *                 .build())
 *             .configurationName("myTestSecurityConfig")
 *             .description("A sample policy")
 *             .networkManagerName("testNetworkManager")
 *             .resourceGroupName("rg1")
 *             .ruleCollectionName("testRuleCollection")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:network:UserRuleCollection myTestSecurityConfig /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityUserConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}
 * ```
 * @property appliesToGroups Groups for configuration
 * @property configurationName The name of the network manager Security Configuration.
 * @property description A description of the user rule collection.
 * @property networkManagerName The name of the network manager.
 * @property resourceGroupName The name of the resource group.
 * @property ruleCollectionName The name of the network manager security Configuration rule collection.
 */
public data class UserRuleCollectionArgs(
    public val appliesToGroups: Output>? = null,
    public val configurationName: Output? = null,
    public val description: Output? = null,
    public val networkManagerName: Output? = null,
    public val resourceGroupName: Output? = null,
    public val ruleCollectionName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.network.UserRuleCollectionArgs =
        com.pulumi.azurenative.network.UserRuleCollectionArgs.builder()
            .appliesToGroups(
                appliesToGroups?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .configurationName(configurationName?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .networkManagerName(networkManagerName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .ruleCollectionName(ruleCollectionName?.applyValue({ args0 -> args0 })).build()
}

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

    private var configurationName: Output? = null

    private var description: Output? = null

    private var networkManagerName: Output? = null

    private var resourceGroupName: Output? = null

    private var ruleCollectionName: Output? = null

    /**
     * @param value Groups for configuration
     */
    @JvmName("mlsgayijvwxjphyg")
    public suspend fun appliesToGroups(`value`: Output>) {
        this.appliesToGroups = value
    }

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

    /**
     * @param values Groups for configuration
     */
    @JvmName("xjgqvtoqcudnlpau")
    public suspend fun appliesToGroups(values: List>) {
        this.appliesToGroups = Output.all(values)
    }

    /**
     * @param value The name of the network manager Security Configuration.
     */
    @JvmName("ymlovvbsjjjiudce")
    public suspend fun configurationName(`value`: Output) {
        this.configurationName = value
    }

    /**
     * @param value A description of the user rule collection.
     */
    @JvmName("krwmdcsnyakptkpf")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The name of the network manager.
     */
    @JvmName("ljxvtjgnkphnmutw")
    public suspend fun networkManagerName(`value`: Output) {
        this.networkManagerName = value
    }

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

    /**
     * @param value The name of the network manager security Configuration rule collection.
     */
    @JvmName("qkpywlimwarnkvht")
    public suspend fun ruleCollectionName(`value`: Output) {
        this.ruleCollectionName = value
    }

    /**
     * @param value Groups for configuration
     */
    @JvmName("tufulmypvlhuaspb")
    public suspend fun appliesToGroups(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.appliesToGroups = mapped
    }

    /**
     * @param argument Groups for configuration
     */
    @JvmName("fyiwvglwopahjikg")
    public suspend fun appliesToGroups(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            NetworkManagerSecurityGroupItemArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.appliesToGroups = mapped
    }

    /**
     * @param argument Groups for configuration
     */
    @JvmName("ragdciavstxpdrvx")
    public suspend fun appliesToGroups(vararg argument: suspend NetworkManagerSecurityGroupItemArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            NetworkManagerSecurityGroupItemArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.appliesToGroups = mapped
    }

    /**
     * @param argument Groups for configuration
     */
    @JvmName("pqjbfcbayimeyoet")
    public suspend fun appliesToGroups(argument: suspend NetworkManagerSecurityGroupItemArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            NetworkManagerSecurityGroupItemArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.appliesToGroups = mapped
    }

    /**
     * @param values Groups for configuration
     */
    @JvmName("nexavksvlucfkfhn")
    public suspend fun appliesToGroups(vararg values: NetworkManagerSecurityGroupItemArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.appliesToGroups = mapped
    }

    /**
     * @param value The name of the network manager Security Configuration.
     */
    @JvmName("mqbdgktvwjulbikn")
    public suspend fun configurationName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.configurationName = mapped
    }

    /**
     * @param value A description of the user rule collection.
     */
    @JvmName("githocuibsohqqus")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

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

    /**
     * @param value The name of the resource group.
     */
    @JvmName("cagfcwsfbakdgqeu")
    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 network manager security Configuration rule collection.
     */
    @JvmName("cqupankxepktnaik")
    public suspend fun ruleCollectionName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleCollectionName = mapped
    }

    internal fun build(): UserRuleCollectionArgs = UserRuleCollectionArgs(
        appliesToGroups = appliesToGroups,
        configurationName = configurationName,
        description = description,
        networkManagerName = networkManagerName,
        resourceGroupName = resourceGroupName,
        ruleCollectionName = ruleCollectionName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy