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

com.pulumi.gcp.compute.kotlin.inputs.FirewallDenyArgs.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.inputs.FirewallDenyArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property ports An optional list of ports to which this rule applies. This field
 * is only applicable for UDP or TCP protocol. Each entry must be
 * either an integer or a range. If not specified, this rule
 * applies to connections through any port.
 * Example inputs include: ["22"], ["80","443"], and
 * ["12345-12349"].
 * @property protocol The IP protocol to which this rule applies. The protocol type is
 * required when creating a firewall rule. This value can either be
 * one of the following well known protocol strings (tcp, udp,
 * icmp, esp, ah, sctp, ipip, all), or the IP protocol number.
 */
public data class FirewallDenyArgs(
    public val ports: Output>? = null,
    public val protocol: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.inputs.FirewallDenyArgs =
        com.pulumi.gcp.compute.inputs.FirewallDenyArgs.builder()
            .ports(ports?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .protocol(protocol.applyValue({ args0 -> args0 })).build()
}

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

    private var protocol: Output? = null

    /**
     * @param value An optional list of ports to which this rule applies. This field
     * is only applicable for UDP or TCP protocol. Each entry must be
     * either an integer or a range. If not specified, this rule
     * applies to connections through any port.
     * Example inputs include: ["22"], ["80","443"], and
     * ["12345-12349"].
     */
    @JvmName("fijkrbnivxdsbhlw")
    public suspend fun ports(`value`: Output>) {
        this.ports = value
    }

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

    /**
     * @param values An optional list of ports to which this rule applies. This field
     * is only applicable for UDP or TCP protocol. Each entry must be
     * either an integer or a range. If not specified, this rule
     * applies to connections through any port.
     * Example inputs include: ["22"], ["80","443"], and
     * ["12345-12349"].
     */
    @JvmName("oexlllkerfmuljlk")
    public suspend fun ports(values: List>) {
        this.ports = Output.all(values)
    }

    /**
     * @param value The IP protocol to which this rule applies. The protocol type is
     * required when creating a firewall rule. This value can either be
     * one of the following well known protocol strings (tcp, udp,
     * icmp, esp, ah, sctp, ipip, all), or the IP protocol number.
     */
    @JvmName("sfnqkwacoxundbfm")
    public suspend fun protocol(`value`: Output) {
        this.protocol = value
    }

    /**
     * @param value An optional list of ports to which this rule applies. This field
     * is only applicable for UDP or TCP protocol. Each entry must be
     * either an integer or a range. If not specified, this rule
     * applies to connections through any port.
     * Example inputs include: ["22"], ["80","443"], and
     * ["12345-12349"].
     */
    @JvmName("lmwaakqfqxdwrsdl")
    public suspend fun ports(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ports = mapped
    }

    /**
     * @param values An optional list of ports to which this rule applies. This field
     * is only applicable for UDP or TCP protocol. Each entry must be
     * either an integer or a range. If not specified, this rule
     * applies to connections through any port.
     * Example inputs include: ["22"], ["80","443"], and
     * ["12345-12349"].
     */
    @JvmName("imkggivmlqvnpadj")
    public suspend fun ports(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ports = mapped
    }

    /**
     * @param value The IP protocol to which this rule applies. The protocol type is
     * required when creating a firewall rule. This value can either be
     * one of the following well known protocol strings (tcp, udp,
     * icmp, esp, ah, sctp, ipip, all), or the IP protocol number.
     */
    @JvmName("hglfspkjgxaumlem")
    public suspend fun protocol(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    internal fun build(): FirewallDenyArgs = FirewallDenyArgs(
        ports = ports,
        protocol = protocol ?: throw PulumiNullFieldException("protocol"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy