com.pulumi.gcp.compute.kotlin.inputs.RouterNatRuleArgs.kt Maven / Gradle / Ivy
@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.RouterNatRuleArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
*
* @property action The action to be enforced for traffic that matches this rule.
* Structure is documented below.
* @property description An optional description of this rule.
* @property match CEL expression that specifies the match condition that egress traffic from a VM is evaluated against.
* If it evaluates to true, the corresponding action is enforced.
* The following examples are valid match expressions for public NAT:
* "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
* "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'"
* The following example is a valid match expression for private NAT:
* "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
* @property ruleNumber An integer uniquely identifying a rule in the list.
* The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
*/
public data class RouterNatRuleArgs(
public val action: Output? = null,
public val description: Output? = null,
public val match: Output,
public val ruleNumber: Output,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.inputs.RouterNatRuleArgs =
com.pulumi.gcp.compute.inputs.RouterNatRuleArgs.builder()
.action(action?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.description(description?.applyValue({ args0 -> args0 }))
.match(match.applyValue({ args0 -> args0 }))
.ruleNumber(ruleNumber.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [RouterNatRuleArgs].
*/
@PulumiTagMarker
public class RouterNatRuleArgsBuilder internal constructor() {
private var action: Output? = null
private var description: Output? = null
private var match: Output? = null
private var ruleNumber: Output? = null
/**
* @param value The action to be enforced for traffic that matches this rule.
* Structure is documented below.
*/
@JvmName("rklrfnnesqdhxwqy")
public suspend fun action(`value`: Output) {
this.action = value
}
/**
* @param value An optional description of this rule.
*/
@JvmName("fonjycpgcsqfravy")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value CEL expression that specifies the match condition that egress traffic from a VM is evaluated against.
* If it evaluates to true, the corresponding action is enforced.
* The following examples are valid match expressions for public NAT:
* "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
* "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'"
* The following example is a valid match expression for private NAT:
* "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
*/
@JvmName("qghgbdlikekchrjo")
public suspend fun match(`value`: Output) {
this.match = value
}
/**
* @param value An integer uniquely identifying a rule in the list.
* The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
*/
@JvmName("jjvrjaxktiwovlcl")
public suspend fun ruleNumber(`value`: Output) {
this.ruleNumber = value
}
/**
* @param value The action to be enforced for traffic that matches this rule.
* Structure is documented below.
*/
@JvmName("qmbbdrpxfpeijkuq")
public suspend fun action(`value`: RouterNatRuleActionArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.action = mapped
}
/**
* @param argument The action to be enforced for traffic that matches this rule.
* Structure is documented below.
*/
@JvmName("xhpjvoyxinwfmipf")
public suspend fun action(argument: suspend RouterNatRuleActionArgsBuilder.() -> Unit) {
val toBeMapped = RouterNatRuleActionArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.action = mapped
}
/**
* @param value An optional description of this rule.
*/
@JvmName("rrhtvawvanmcyumj")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value CEL expression that specifies the match condition that egress traffic from a VM is evaluated against.
* If it evaluates to true, the corresponding action is enforced.
* The following examples are valid match expressions for public NAT:
* "inIpRange(destination.ip, '1.1.0.0/16') || inIpRange(destination.ip, '2.2.0.0/16')"
* "destination.ip == '1.1.0.1' || destination.ip == '8.8.8.8'"
* The following example is a valid match expression for private NAT:
* "nexthop.hub == 'https://networkconnectivity.googleapis.com/v1alpha1/projects/my-project/global/hub/hub-1'"
*/
@JvmName("fuibbjsvbjsuhdwg")
public suspend fun match(`value`: String) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.match = mapped
}
/**
* @param value An integer uniquely identifying a rule in the list.
* The rule number must be a positive value between 0 and 65000, and must be unique among rules within a NAT.
*/
@JvmName("tuubnuwlkkyjatct")
public suspend fun ruleNumber(`value`: Int) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.ruleNumber = mapped
}
internal fun build(): RouterNatRuleArgs = RouterNatRuleArgs(
action = action,
description = description,
match = match ?: throw PulumiNullFieldException("match"),
ruleNumber = ruleNumber ?: throw PulumiNullFieldException("ruleNumber"),
)
}