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

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

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.network.kotlin

import com.pulumi.azurenative.network.NspAccessRuleArgs.builder
import com.pulumi.azurenative.network.kotlin.enums.AccessRuleDirection
import com.pulumi.azurenative.network.kotlin.inputs.SubscriptionIdArgs
import com.pulumi.azurenative.network.kotlin.inputs.SubscriptionIdArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * The NSP access rule resource
 * Azure REST API version: 2021-02-01-preview. Prior API version in Azure Native 1.x: 2021-02-01-preview.
 * Other available API versions: 2023-07-01-preview, 2023-08-01-preview.
 * ## Example Usage
 * ### NspAccessRulePut
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var nspAccessRule = new AzureNative.Network.NspAccessRule("nspAccessRule", new()
 *     {
 *         AccessRuleName = "accessRule1",
 *         AddressPrefixes = new[]
 *         {
 *             "10.11.0.0/16",
 *             "10.10.1.0/24",
 *         },
 *         Direction = AzureNative.Network.AccessRuleDirection.Inbound,
 *         NetworkSecurityPerimeterName = "nsp1",
 *         ProfileName = "profile1",
 *         ResourceGroupName = "rg1",
 *     });
 * });
 * ```
 * ```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.NewNspAccessRule(ctx, "nspAccessRule", &network.NspAccessRuleArgs{
 * 			AccessRuleName: pulumi.String("accessRule1"),
 * 			AddressPrefixes: pulumi.StringArray{
 * 				pulumi.String("10.11.0.0/16"),
 * 				pulumi.String("10.10.1.0/24"),
 * 			},
 * 			Direction:                    pulumi.String(network.AccessRuleDirectionInbound),
 * 			NetworkSecurityPerimeterName: pulumi.String("nsp1"),
 * 			ProfileName:                  pulumi.String("profile1"),
 * 			ResourceGroupName:            pulumi.String("rg1"),
 * 		})
 * 		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.NspAccessRule;
 * import com.pulumi.azurenative.network.NspAccessRuleArgs;
 * 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 nspAccessRule = new NspAccessRule("nspAccessRule", NspAccessRuleArgs.builder()
 *             .accessRuleName("accessRule1")
 *             .addressPrefixes(
 *                 "10.11.0.0/16",
 *                 "10.10.1.0/24")
 *             .direction("Inbound")
 *             .networkSecurityPerimeterName("nsp1")
 *             .profileName("profile1")
 *             .resourceGroupName("rg1")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:network:NspAccessRule accessRule1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityPerimeters/{networkSecurityPerimeterName}/profiles/{profileName}/accessRules/{accessRuleName}
 * ```
 * @property accessRuleName The name of the NSP access rule.
 * @property addressPrefixes Inbound address prefixes (IPv4/IPv6)
 * @property direction Direction that specifies whether the access rules is inbound/outbound.
 * @property emailAddresses Outbound rules email address format.
 * @property fullyQualifiedDomainNames Outbound rules fully qualified domain name format.
 * @property id Resource ID.
 * @property location Resource location.
 * @property name The name of the access rule that is unique within a profile. This name can be used to access the resource.
 * @property networkSecurityPerimeterName The name of the network security perimeter.
 * @property phoneNumbers Outbound rules phone number format.
 * @property profileName The name of the NSP profile.
 * @property resourceGroupName The name of the resource group.
 * @property subscriptions List of subscription ids
 * @property tags Resource tags.
 */
public data class NspAccessRuleArgs(
    public val accessRuleName: Output? = null,
    public val addressPrefixes: Output>? = null,
    public val direction: Output>? = null,
    public val emailAddresses: Output>? = null,
    public val fullyQualifiedDomainNames: Output>? = null,
    public val id: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val networkSecurityPerimeterName: Output? = null,
    public val phoneNumbers: Output>? = null,
    public val profileName: Output? = null,
    public val resourceGroupName: Output? = null,
    public val subscriptions: Output>? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.network.NspAccessRuleArgs =
        com.pulumi.azurenative.network.NspAccessRuleArgs.builder()
            .accessRuleName(accessRuleName?.applyValue({ args0 -> args0 }))
            .addressPrefixes(addressPrefixes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .direction(
                direction?.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .emailAddresses(emailAddresses?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .fullyQualifiedDomainNames(
                fullyQualifiedDomainNames?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .id(id?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .networkSecurityPerimeterName(networkSecurityPerimeterName?.applyValue({ args0 -> args0 }))
            .phoneNumbers(phoneNumbers?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .profileName(profileName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .subscriptions(
                subscriptions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [NspAccessRuleArgs].
 */
@PulumiTagMarker
public class NspAccessRuleArgsBuilder internal constructor() {
    private var accessRuleName: Output? = null

    private var addressPrefixes: Output>? = null

    private var direction: Output>? = null

    private var emailAddresses: Output>? = null

    private var fullyQualifiedDomainNames: Output>? = null

    private var id: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var networkSecurityPerimeterName: Output? = null

    private var phoneNumbers: Output>? = null

    private var profileName: Output? = null

    private var resourceGroupName: Output? = null

    private var subscriptions: Output>? = null

    private var tags: Output>? = null

    /**
     * @param value The name of the NSP access rule.
     */
    @JvmName("mohfskqxajxlpsbv")
    public suspend fun accessRuleName(`value`: Output) {
        this.accessRuleName = value
    }

    /**
     * @param value Inbound address prefixes (IPv4/IPv6)
     */
    @JvmName("luworqqnlstysetu")
    public suspend fun addressPrefixes(`value`: Output>) {
        this.addressPrefixes = value
    }

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

    /**
     * @param values Inbound address prefixes (IPv4/IPv6)
     */
    @JvmName("kmagmjemxvvhtlud")
    public suspend fun addressPrefixes(values: List>) {
        this.addressPrefixes = Output.all(values)
    }

    /**
     * @param value Direction that specifies whether the access rules is inbound/outbound.
     */
    @JvmName("ogwdyridoemthxqg")
    public suspend fun direction(`value`: Output>) {
        this.direction = value
    }

    /**
     * @param value Outbound rules email address format.
     */
    @JvmName("rpxamriltvnqxpnm")
    public suspend fun emailAddresses(`value`: Output>) {
        this.emailAddresses = value
    }

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

    /**
     * @param values Outbound rules email address format.
     */
    @JvmName("ibwcnmqdngyouoyh")
    public suspend fun emailAddresses(values: List>) {
        this.emailAddresses = Output.all(values)
    }

    /**
     * @param value Outbound rules fully qualified domain name format.
     */
    @JvmName("ldlnarnknlkhydkc")
    public suspend fun fullyQualifiedDomainNames(`value`: Output>) {
        this.fullyQualifiedDomainNames = value
    }

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

    /**
     * @param values Outbound rules fully qualified domain name format.
     */
    @JvmName("vahkirjcnksjkxmf")
    public suspend fun fullyQualifiedDomainNames(values: List>) {
        this.fullyQualifiedDomainNames = Output.all(values)
    }

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

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

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

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

    /**
     * @param value Outbound rules phone number format.
     */
    @JvmName("xsgxagdsgtbwykur")
    public suspend fun phoneNumbers(`value`: Output>) {
        this.phoneNumbers = value
    }

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

    /**
     * @param values Outbound rules phone number format.
     */
    @JvmName("digxwgnlldcjylgc")
    public suspend fun phoneNumbers(values: List>) {
        this.phoneNumbers = Output.all(values)
    }

    /**
     * @param value The name of the NSP profile.
     */
    @JvmName("ugcjmakcfxprdxea")
    public suspend fun profileName(`value`: Output) {
        this.profileName = value
    }

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

    /**
     * @param value List of subscription ids
     */
    @JvmName("fshqsxdkdokekqij")
    public suspend fun subscriptions(`value`: Output>) {
        this.subscriptions = value
    }

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

    /**
     * @param values List of subscription ids
     */
    @JvmName("iylcvivuyrjphwnf")
    public suspend fun subscriptions(values: List>) {
        this.subscriptions = Output.all(values)
    }

    /**
     * @param value Resource tags.
     */
    @JvmName("ekvvhiuvrdbtbdky")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

    /**
     * @param value Inbound address prefixes (IPv4/IPv6)
     */
    @JvmName("rcpxgrjrtyuwteqx")
    public suspend fun addressPrefixes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.addressPrefixes = mapped
    }

    /**
     * @param values Inbound address prefixes (IPv4/IPv6)
     */
    @JvmName("arawcsqkucopicbm")
    public suspend fun addressPrefixes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.addressPrefixes = mapped
    }

    /**
     * @param value Direction that specifies whether the access rules is inbound/outbound.
     */
    @JvmName("mfcidojyepnxjaey")
    public suspend fun direction(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value Direction that specifies whether the access rules is inbound/outbound.
     */
    @JvmName("flmusyurgqprrbvu")
    public fun direction(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value Direction that specifies whether the access rules is inbound/outbound.
     */
    @JvmName("ghythrcrtgjvwtom")
    public fun direction(`value`: AccessRuleDirection) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value Outbound rules email address format.
     */
    @JvmName("qmbhfeegkdyhusyv")
    public suspend fun emailAddresses(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.emailAddresses = mapped
    }

    /**
     * @param values Outbound rules email address format.
     */
    @JvmName("qgmhkoxpamhsypwl")
    public suspend fun emailAddresses(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.emailAddresses = mapped
    }

    /**
     * @param value Outbound rules fully qualified domain name format.
     */
    @JvmName("tprdghihlpqwkefq")
    public suspend fun fullyQualifiedDomainNames(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fullyQualifiedDomainNames = mapped
    }

    /**
     * @param values Outbound rules fully qualified domain name format.
     */
    @JvmName("ehouolbqlpkomxuk")
    public suspend fun fullyQualifiedDomainNames(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.fullyQualifiedDomainNames = mapped
    }

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

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

    /**
     * @param value The name of the access rule that is unique within a profile. This name can be used to access the resource.
     */
    @JvmName("cheejabdhqhcbxus")
    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 perimeter.
     */
    @JvmName("goettmmygmntinon")
    public suspend fun networkSecurityPerimeterName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.networkSecurityPerimeterName = mapped
    }

    /**
     * @param value Outbound rules phone number format.
     */
    @JvmName("qwcsefavievjwwyt")
    public suspend fun phoneNumbers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.phoneNumbers = mapped
    }

    /**
     * @param values Outbound rules phone number format.
     */
    @JvmName("tsaskcxopgsvlbyb")
    public suspend fun phoneNumbers(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.phoneNumbers = mapped
    }

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

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

    /**
     * @param value List of subscription ids
     */
    @JvmName("erhakfjuaxyxaumo")
    public suspend fun subscriptions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.subscriptions = mapped
    }

    /**
     * @param argument List of subscription ids
     */
    @JvmName("rdmoovuovewqilmk")
    public suspend fun subscriptions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            SubscriptionIdArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.subscriptions = mapped
    }

    /**
     * @param argument List of subscription ids
     */
    @JvmName("isvhkxrtefgredpc")
    public suspend fun subscriptions(vararg argument: suspend SubscriptionIdArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            SubscriptionIdArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.subscriptions = mapped
    }

    /**
     * @param argument List of subscription ids
     */
    @JvmName("qfiuerkhcbulfimn")
    public suspend fun subscriptions(argument: suspend SubscriptionIdArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(SubscriptionIdArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.subscriptions = mapped
    }

    /**
     * @param values List of subscription ids
     */
    @JvmName("kftchvjrbkcybayi")
    public suspend fun subscriptions(vararg values: SubscriptionIdArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.subscriptions = mapped
    }

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

    /**
     * @param values Resource tags.
     */
    @JvmName("yevjmwspxhvwfnhn")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): NspAccessRuleArgs = NspAccessRuleArgs(
        accessRuleName = accessRuleName,
        addressPrefixes = addressPrefixes,
        direction = direction,
        emailAddresses = emailAddresses,
        fullyQualifiedDomainNames = fullyQualifiedDomainNames,
        id = id,
        location = location,
        name = name,
        networkSecurityPerimeterName = networkSecurityPerimeterName,
        phoneNumbers = phoneNumbers,
        profileName = profileName,
        resourceGroupName = resourceGroupName,
        subscriptions = subscriptions,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy