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

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

package com.pulumi.digitalocean.kotlin.inputs

import com.pulumi.digitalocean.inputs.GetFirewallOutboundRule.builder
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

/**
 *
 * @property destinationAddresses An array of strings containing the IPv4
 * addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the
 * outbound traffic will be allowed.
 * @property destinationDropletIds An array containing the IDs of
 * the Droplets to which the outbound traffic will be allowed.
 * @property destinationKubernetesIds
 * @property destinationLoadBalancerUids An array containing the IDs
 * of the Load Balancers to which the outbound traffic will be allowed.
 * @property destinationTags An array containing the names of Tags
 * corresponding to groups of Droplets to which the outbound traffic will
 * be allowed.
 * traffic.
 * @property portRange The ports on which traffic will be allowed
 * specified as a string containing a single port, a range (e.g. "8000-9000"),
 * or "1-65535" to open all ports for a protocol. Required for when protocol is
 * `tcp` or `udp`.
 * @property protocol The type of traffic to be allowed.
 * This may be one of "tcp", "udp", or "icmp".
 */
public data class GetFirewallOutboundRule(
    public val destinationAddresses: List? = null,
    public val destinationDropletIds: List? = null,
    public val destinationKubernetesIds: List? = null,
    public val destinationLoadBalancerUids: List? = null,
    public val destinationTags: List? = null,
    public val portRange: String? = null,
    public val protocol: String,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.digitalocean.inputs.GetFirewallOutboundRule =
        com.pulumi.digitalocean.inputs.GetFirewallOutboundRule.builder()
            .destinationAddresses(destinationAddresses?.let({ args0 -> args0.map({ args0 -> args0 }) }))
            .destinationDropletIds(destinationDropletIds?.let({ args0 -> args0.map({ args0 -> args0 }) }))
            .destinationKubernetesIds(destinationKubernetesIds?.let({ args0 -> args0.map({ args0 -> args0 }) }))
            .destinationLoadBalancerUids(
                destinationLoadBalancerUids?.let({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .destinationTags(destinationTags?.let({ args0 -> args0.map({ args0 -> args0 }) }))
            .portRange(portRange?.let({ args0 -> args0 }))
            .protocol(protocol.let({ args0 -> args0 })).build()
}

/**
 * Builder for [GetFirewallOutboundRule].
 */
@PulumiTagMarker
public class GetFirewallOutboundRuleBuilder internal constructor() {
    private var destinationAddresses: List? = null

    private var destinationDropletIds: List? = null

    private var destinationKubernetesIds: List? = null

    private var destinationLoadBalancerUids: List? = null

    private var destinationTags: List? = null

    private var portRange: String? = null

    private var protocol: String? = null

    /**
     * @param value An array of strings containing the IPv4
     * addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the
     * outbound traffic will be allowed.
     */
    @JvmName("rblkpxfcpdrifjxy")
    public suspend fun destinationAddresses(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> args0 })
        this.destinationAddresses = mapped
    }

    /**
     * @param values An array of strings containing the IPv4
     * addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the
     * outbound traffic will be allowed.
     */
    @JvmName("liboofqknhmflrgm")
    public suspend fun destinationAddresses(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> args0 })
        this.destinationAddresses = mapped
    }

    /**
     * @param value An array containing the IDs of
     * the Droplets to which the outbound traffic will be allowed.
     */
    @JvmName("idujdabjkddgkhhs")
    public suspend fun destinationDropletIds(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> args0 })
        this.destinationDropletIds = mapped
    }

    /**
     * @param values An array containing the IDs of
     * the Droplets to which the outbound traffic will be allowed.
     */
    @JvmName("rhcpxxyqbvuuueog")
    public suspend fun destinationDropletIds(vararg values: Int) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> args0 })
        this.destinationDropletIds = mapped
    }

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

    /**
     * @param values
     */
    @JvmName("wwvaoucybgbmmmwu")
    public suspend fun destinationKubernetesIds(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> args0 })
        this.destinationKubernetesIds = mapped
    }

    /**
     * @param value An array containing the IDs
     * of the Load Balancers to which the outbound traffic will be allowed.
     */
    @JvmName("teluljqbsgdguyfj")
    public suspend fun destinationLoadBalancerUids(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> args0 })
        this.destinationLoadBalancerUids = mapped
    }

    /**
     * @param values An array containing the IDs
     * of the Load Balancers to which the outbound traffic will be allowed.
     */
    @JvmName("cgfgaerqrlsisvop")
    public suspend fun destinationLoadBalancerUids(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> args0 })
        this.destinationLoadBalancerUids = mapped
    }

    /**
     * @param value An array containing the names of Tags
     * corresponding to groups of Droplets to which the outbound traffic will
     * be allowed.
     * traffic.
     */
    @JvmName("vfofhgaahgshiesh")
    public suspend fun destinationTags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> args0 })
        this.destinationTags = mapped
    }

    /**
     * @param values An array containing the names of Tags
     * corresponding to groups of Droplets to which the outbound traffic will
     * be allowed.
     * traffic.
     */
    @JvmName("gxjhptblodlywmfo")
    public suspend fun destinationTags(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> args0 })
        this.destinationTags = mapped
    }

    /**
     * @param value The ports on which traffic will be allowed
     * specified as a string containing a single port, a range (e.g. "8000-9000"),
     * or "1-65535" to open all ports for a protocol. Required for when protocol is
     * `tcp` or `udp`.
     */
    @JvmName("eumkwbdkxxnwupnf")
    public suspend fun portRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> args0 })
        this.portRange = mapped
    }

    /**
     * @param value The type of traffic to be allowed.
     * This may be one of "tcp", "udp", or "icmp".
     */
    @JvmName("emksxicriorofkvb")
    public suspend fun protocol(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> args0 })
        this.protocol = mapped
    }

    internal fun build(): GetFirewallOutboundRule = GetFirewallOutboundRule(
        destinationAddresses = destinationAddresses,
        destinationDropletIds = destinationDropletIds,
        destinationKubernetesIds = destinationKubernetesIds,
        destinationLoadBalancerUids = destinationLoadBalancerUids,
        destinationTags = destinationTags,
        portRange = portRange,
        protocol = protocol ?: throw PulumiNullFieldException("protocol"),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy