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

com.pulumi.gcp.compute.kotlin.inputs.RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs.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.RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs.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 ipProtocol 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`, `ipip`, `sctp`), or the IP protocol number.
 * @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: ``.
 */
public data class RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs(
    public val ipProtocol: Output,
    public val ports: Output>? = null,
) :
    ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.inputs.RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs =
        com.pulumi.gcp.compute.inputs.RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs.builder()
            .ipProtocol(ipProtocol.applyValue({ args0 -> args0 }))
            .ports(ports?.applyValue({ args0 -> args0.map({ args0 -> args0 }) })).build()
}

/**
 * Builder for [RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs].
 */
@PulumiTagMarker
public class RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgsBuilder internal constructor() {
    private var ipProtocol: Output? = null

    private var ports: Output>? = null

    /**
     * @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`, `ipip`, `sctp`), or the IP protocol number.
     */
    @JvmName("lionopcfjcnnxsfu")
    public suspend fun ipProtocol(`value`: Output) {
        this.ipProtocol = 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: ``.
     */
    @JvmName("mkhhridhjmspvcjv")
    public suspend fun ports(`value`: Output>) {
        this.ports = value
    }

    @JvmName("nglvfvjypoymdgqw")
    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: ``.
     */
    @JvmName("jkfktqjcrrhyeqlm")
    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`, `ipip`, `sctp`), or the IP protocol number.
     */
    @JvmName("kldmnguaawuywvyh")
    public suspend fun ipProtocol(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ipProtocol = mapped
    }

    /**
     * @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: ``.
     */
    @JvmName("wrkmvasmnrhxmnof")
    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: ``.
     */
    @JvmName("jdjrkcohddgumssi")
    public suspend fun ports(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ports = mapped
    }

    internal fun build(): RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs =
        RegionNetworkFirewallPolicyRuleMatchLayer4ConfigArgs(
            ipProtocol = ipProtocol ?: throw PulumiNullFieldException("ipProtocol"),
            ports = ports,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy