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

com.pulumi.azurenative.servicefabric.kotlin.inputs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.servicefabric.kotlin.inputs

import com.pulumi.azurenative.servicefabric.inputs.NetworkSecurityRuleArgs.builder
import com.pulumi.azurenative.servicefabric.kotlin.enums.Access
import com.pulumi.azurenative.servicefabric.kotlin.enums.Direction
import com.pulumi.azurenative.servicefabric.kotlin.enums.NsgProtocol
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.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Describes a network security rule.
 * @property access The network traffic is allowed or denied.
 * @property description Network security rule description.
 * @property destinationAddressPrefix The destination address prefix. CIDR or destination IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
 * @property destinationAddressPrefixes The destination address prefixes. CIDR or destination IP ranges.
 * @property destinationPortRange he destination port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
 * @property destinationPortRanges The destination port ranges.
 * @property direction Network security rule direction.
 * @property name Network security rule name.
 * @property priority The priority of the rule. The value can be in the range 1000 to 3000. Values outside this range are reserved for Service Fabric ManagerCluster Resource Provider. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule.
 * @property protocol Network protocol this rule applies to.
 * @property sourceAddressPrefix The CIDR or source IP range. Asterisk '*' can also be used to match all source IPs. Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used. If this is an ingress rule, specifies where network traffic originates from.
 * @property sourceAddressPrefixes The CIDR or source IP ranges.
 * @property sourcePortRange The source port or range. Integer or range between 0 and 65535. Asterisk '*' can also be used to match all ports.
 * @property sourcePortRanges The source port ranges.
 */
public data class NetworkSecurityRuleArgs(
    public val access: Output>,
    public val description: Output? = null,
    public val destinationAddressPrefix: Output? = null,
    public val destinationAddressPrefixes: Output>? = null,
    public val destinationPortRange: Output? = null,
    public val destinationPortRanges: Output>? = null,
    public val direction: Output>,
    public val name: Output,
    public val priority: Output,
    public val protocol: Output>,
    public val sourceAddressPrefix: Output? = null,
    public val sourceAddressPrefixes: Output>? = null,
    public val sourcePortRange: Output? = null,
    public val sourcePortRanges: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.servicefabric.inputs.NetworkSecurityRuleArgs =
        com.pulumi.azurenative.servicefabric.inputs.NetworkSecurityRuleArgs.builder()
            .access(
                access.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .description(description?.applyValue({ args0 -> args0 }))
            .destinationAddressPrefix(destinationAddressPrefix?.applyValue({ args0 -> args0 }))
            .destinationAddressPrefixes(
                destinationAddressPrefixes?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .destinationPortRange(destinationPortRange?.applyValue({ args0 -> args0 }))
            .destinationPortRanges(destinationPortRanges?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .direction(
                direction.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .name(name.applyValue({ args0 -> args0 }))
            .priority(priority.applyValue({ args0 -> args0 }))
            .protocol(
                protocol.applyValue({ args0 ->
                    args0.transform({ args0 -> args0 }, { args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .sourceAddressPrefix(sourceAddressPrefix?.applyValue({ args0 -> args0 }))
            .sourceAddressPrefixes(sourceAddressPrefixes?.applyValue({ args0 -> args0.map({ 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 destinationPortRange: Output? = null

    private var destinationPortRanges: Output>? = null

    private var direction: Output>? = null

    private var name: Output? = null

    private var priority: Output? = null

    private var protocol: Output>? = null

    private var sourceAddressPrefix: Output? = null

    private var sourceAddressPrefixes: Output>? = null

    private var sourcePortRange: Output? = null

    private var sourcePortRanges: Output>? = null

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

    /**
     * @param value Network security rule description.
     */
    @JvmName("gefrxkjqwwsbwqrr")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

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

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

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

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

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

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

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

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

    /**
     * @param value Network security rule direction.
     */
    @JvmName("wdfpnvbigfgdhgvm")
    public suspend fun direction(`value`: Output>) {
        this.direction = value
    }

    /**
     * @param value Network security rule name.
     */
    @JvmName("vcbunqwqujrftuul")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The priority of the rule. The value can be in the range 1000 to 3000. Values outside this range are reserved for Service Fabric ManagerCluster Resource Provider. 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("hbmtevnpottkstau")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

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

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

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

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

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

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

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

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

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

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

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

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

    /**
     * @param value Network security rule description.
     */
    @JvmName("naqelmcmdlrdyucu")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

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

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

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

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

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

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

    /**
     * @param value Network security rule direction.
     */
    @JvmName("tovuubolehgxkhip")
    public suspend fun direction(`value`: Either) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.direction = mapped
    }

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

    /**
     * @param value Network security rule direction.
     */
    @JvmName("tecismnsmlnpstad")
    public fun direction(`value`: Direction) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.direction = mapped
    }

    /**
     * @param value Network security rule name.
     */
    @JvmName("bvoswuonvsdyrtnc")
    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. The value can be in the range 1000 to 3000. Values outside this range are reserved for Service Fabric ManagerCluster Resource Provider. 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("khfmdpglpkqmuamc")
    public suspend fun priority(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.priority = mapped
    }

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

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

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

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

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

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

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

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

    /**
     * @param values The source port ranges.
     */
    @JvmName("mxynsogbyxtncxqi")
    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 ?: throw PulumiNullFieldException("access"),
        description = description,
        destinationAddressPrefix = destinationAddressPrefix,
        destinationAddressPrefixes = destinationAddressPrefixes,
        destinationPortRange = destinationPortRange,
        destinationPortRanges = destinationPortRanges,
        direction = direction ?: throw PulumiNullFieldException("direction"),
        name = name ?: throw PulumiNullFieldException("name"),
        priority = priority ?: throw PulumiNullFieldException("priority"),
        protocol = protocol ?: throw PulumiNullFieldException("protocol"),
        sourceAddressPrefix = sourceAddressPrefix,
        sourceAddressPrefixes = sourceAddressPrefixes,
        sourcePortRange = sourcePortRange,
        sourcePortRanges = sourcePortRanges,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy