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

com.pulumi.digitalocean.kotlin.inputs.FirewallOutboundRuleArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.digitalocean.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.digitalocean.inputs.FirewallOutboundRuleArgs.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 An array containing the IDs of
 * the Kubernetes clusters to which the outbound traffic will be allowed.
 * @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.
 * @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 FirewallOutboundRuleArgs(
    public val destinationAddresses: Output>? = null,
    public val destinationDropletIds: Output>? = null,
    public val destinationKubernetesIds: Output>? = null,
    public val destinationLoadBalancerUids: Output>? = null,
    public val destinationTags: Output>? = null,
    public val portRange: Output? = null,
    public val protocol: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.digitalocean.inputs.FirewallOutboundRuleArgs =
        com.pulumi.digitalocean.inputs.FirewallOutboundRuleArgs.builder()
            .destinationAddresses(destinationAddresses?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .destinationDropletIds(destinationDropletIds?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .destinationKubernetesIds(
                destinationKubernetesIds?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .destinationLoadBalancerUids(
                destinationLoadBalancerUids?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .destinationTags(destinationTags?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .portRange(portRange?.applyValue({ args0 -> args0 }))
            .protocol(protocol.applyValue({ args0 -> args0 })).build()
}

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

    private var destinationDropletIds: Output>? = null

    private var destinationKubernetesIds: Output>? = null

    private var destinationLoadBalancerUids: Output>? = null

    private var destinationTags: Output>? = null

    private var portRange: Output? = null

    private var protocol: Output? = 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("txascsjiqpwdrrde")
    public suspend fun destinationAddresses(`value`: Output>) {
        this.destinationAddresses = value
    }

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

    /**
     * @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("rmulwdetwdjvsgne")
    public suspend fun destinationAddresses(values: List>) {
        this.destinationAddresses = Output.all(values)
    }

    /**
     * @param value An array containing the IDs of
     * the Droplets to which the outbound traffic will be allowed.
     */
    @JvmName("uebubhmmftexusyc")
    public suspend fun destinationDropletIds(`value`: Output>) {
        this.destinationDropletIds = value
    }

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

    /**
     * @param values An array containing the IDs of
     * the Droplets to which the outbound traffic will be allowed.
     */
    @JvmName("khtwfsvexmcjewwu")
    public suspend fun destinationDropletIds(values: List>) {
        this.destinationDropletIds = Output.all(values)
    }

    /**
     * @param value An array containing the IDs of
     * the Kubernetes clusters to which the outbound traffic will be allowed.
     */
    @JvmName("qchkyhtwymasasom")
    public suspend fun destinationKubernetesIds(`value`: Output>) {
        this.destinationKubernetesIds = value
    }

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

    /**
     * @param values An array containing the IDs of
     * the Kubernetes clusters to which the outbound traffic will be allowed.
     */
    @JvmName("agefdlvpqjbesvxh")
    public suspend fun destinationKubernetesIds(values: List>) {
        this.destinationKubernetesIds = Output.all(values)
    }

    /**
     * @param value An array containing the IDs
     * of the Load Balancers to which the outbound traffic will be allowed.
     */
    @JvmName("dkmlgxhipttflmdf")
    public suspend fun destinationLoadBalancerUids(`value`: Output>) {
        this.destinationLoadBalancerUids = value
    }

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

    /**
     * @param values An array containing the IDs
     * of the Load Balancers to which the outbound traffic will be allowed.
     */
    @JvmName("hdgqvonoacaifxvy")
    public suspend fun destinationLoadBalancerUids(values: List>) {
        this.destinationLoadBalancerUids = Output.all(values)
    }

    /**
     * @param value An array containing the names of Tags
     * corresponding to groups of Droplets to which the outbound traffic will
     * be allowed.
     */
    @JvmName("dlgfexcwotfxejti")
    public suspend fun destinationTags(`value`: Output>) {
        this.destinationTags = value
    }

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

    /**
     * @param values An array containing the names of Tags
     * corresponding to groups of Droplets to which the outbound traffic will
     * be allowed.
     */
    @JvmName("klornnlcqndypdqw")
    public suspend fun destinationTags(values: List>) {
        this.destinationTags = Output.all(values)
    }

    /**
     * @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("mefpqbwwmhnuffad")
    public suspend fun portRange(`value`: Output) {
        this.portRange = value
    }

    /**
     * @param value The type of traffic to be allowed.
     * This may be one of "tcp", "udp", or "icmp".
     */
    @JvmName("htucipnrsdecwllk")
    public suspend fun protocol(`value`: Output) {
        this.protocol = value
    }

    /**
     * @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("armfrqcctdxmdboa")
    public suspend fun destinationAddresses(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(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("yqcqidikscsbsqsx")
    public suspend fun destinationAddresses(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.destinationAddresses = mapped
    }

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

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

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

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

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

    /**
     * @param values An array containing the IDs
     * of the Load Balancers to which the outbound traffic will be allowed.
     */
    @JvmName("xgssmerdhtqdgocv")
    public suspend fun destinationLoadBalancerUids(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(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.
     */
    @JvmName("btqknufhlmfbufys")
    public suspend fun destinationTags(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(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.
     */
    @JvmName("ajlgdbghqfxtortm")
    public suspend fun destinationTags(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(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("ixnvrrpkguplhjte")
    public suspend fun portRange(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.portRange = mapped
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy