com.pulumi.awsnative.wafv2.kotlin.inputs.WebAclRuleArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.wafv2.kotlin.inputs
import com.pulumi.awsnative.wafv2.inputs.WebAclRuleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
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.collections.List
import kotlin.jvm.JvmName
/**
* Rule of WebACL that contains condition and action.
* @property action The action that AWS WAF should take on a web request when it matches the rule's statement. Settings at the web ACL level can override the rule action setting.
* This is used only for rules whose statements don't reference a rule group. Rule statements that reference a rule group are `RuleGroupReferenceStatement` and `ManagedRuleGroupStatement` .
* You must set either this `Action` setting or the rule's `OverrideAction` , but not both:
* - If the rule statement doesn't reference a rule group, you must set this rule action setting and you must not set the rule's override action setting.
* - If the rule statement references a rule group, you must not set this action setting, because the actions are already set on the rules inside the rule group. You must set the rule's override action setting to indicate specifically whether to override the actions that are set on the rules in the rule group.
* @property captchaConfig Specifies how AWS WAF should handle `CAPTCHA` evaluations. If you don't specify this, AWS WAF uses the `CAPTCHA` configuration that's defined for the web ACL.
* @property challengeConfig Specifies how AWS WAF should handle `Challenge` evaluations. If you don't specify this, AWS WAF uses the challenge configuration that's defined for the web ACL.
* @property name The name of the rule.
* If you change the name of a `Rule` after you create it and you want the rule's metric name to reflect the change, update the metric name in the rule's `VisibilityConfig` settings. AWS WAF doesn't automatically update the metric name when you update the rule name.
* @property overrideAction The override action to apply to the rules in a rule group, instead of the individual rule action settings. This is used only for rules whose statements reference a rule group. Rule statements that reference a rule group are `RuleGroupReferenceStatement` and `ManagedRuleGroupStatement` .
* Set the override action to none to leave the rule group rule actions in effect. Set it to count to only count matches, regardless of the rule action settings.
* You must set either this `OverrideAction` setting or the `Action` setting, but not both:
* - If the rule statement references a rule group, you must set this override action setting and you must not set the rule's action setting.
* - If the rule statement doesn't reference a rule group, you must set the rule action setting and you must not set the rule's override action setting.
* @property priority If you define more than one `Rule` in a `WebACL` , AWS WAF evaluates each request against the `Rules` in order based on the value of `Priority` . AWS WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different.
* @property ruleLabels Collection of Rule Labels.
* @property statement The AWS WAF processing statement for the rule, for example `ByteMatchStatement` or `SizeConstraintStatement` .
* @property visibilityConfig Defines and enables Amazon CloudWatch metrics and web request sample collection.
* If you change the name of a `Rule` after you create it and you want the rule's metric name to reflect the change, update the metric name as well. AWS WAF doesn't automatically update the metric name.
*/
public data class WebAclRuleArgs(
public val action: Output? = null,
public val captchaConfig: Output? = null,
public val challengeConfig: Output? = null,
public val name: Output,
public val overrideAction: Output? = null,
public val priority: Output,
public val ruleLabels: Output>? = null,
public val statement: Output,
public val visibilityConfig: Output,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.awsnative.wafv2.inputs.WebAclRuleArgs =
com.pulumi.awsnative.wafv2.inputs.WebAclRuleArgs.builder()
.action(action?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.captchaConfig(captchaConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.challengeConfig(challengeConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.name(name.applyValue({ args0 -> args0 }))
.overrideAction(overrideAction?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.priority(priority.applyValue({ args0 -> args0 }))
.ruleLabels(
ruleLabels?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.statement(statement.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.visibilityConfig(
visibilityConfig.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
).build()
}
/**
* Builder for [WebAclRuleArgs].
*/
@PulumiTagMarker
public class WebAclRuleArgsBuilder internal constructor() {
private var action: Output? = null
private var captchaConfig: Output? = null
private var challengeConfig: Output? = null
private var name: Output? = null
private var overrideAction: Output? = null
private var priority: Output? = null
private var ruleLabels: Output>? = null
private var statement: Output? = null
private var visibilityConfig: Output? = null
/**
* @param value The action that AWS WAF should take on a web request when it matches the rule's statement. Settings at the web ACL level can override the rule action setting.
* This is used only for rules whose statements don't reference a rule group. Rule statements that reference a rule group are `RuleGroupReferenceStatement` and `ManagedRuleGroupStatement` .
* You must set either this `Action` setting or the rule's `OverrideAction` , but not both:
* - If the rule statement doesn't reference a rule group, you must set this rule action setting and you must not set the rule's override action setting.
* - If the rule statement references a rule group, you must not set this action setting, because the actions are already set on the rules inside the rule group. You must set the rule's override action setting to indicate specifically whether to override the actions that are set on the rules in the rule group.
*/
@JvmName("upaskbhnamxjyitn")
public suspend fun action(`value`: Output) {
this.action = value
}
/**
* @param value Specifies how AWS WAF should handle `CAPTCHA` evaluations. If you don't specify this, AWS WAF uses the `CAPTCHA` configuration that's defined for the web ACL.
*/
@JvmName("gfcyiwqkpdlllbun")
public suspend fun captchaConfig(`value`: Output) {
this.captchaConfig = value
}
/**
* @param value Specifies how AWS WAF should handle `Challenge` evaluations. If you don't specify this, AWS WAF uses the challenge configuration that's defined for the web ACL.
*/
@JvmName("ccldlhxxmobwbqqs")
public suspend fun challengeConfig(`value`: Output) {
this.challengeConfig = value
}
/**
* @param value The name of the rule.
* If you change the name of a `Rule` after you create it and you want the rule's metric name to reflect the change, update the metric name in the rule's `VisibilityConfig` settings. AWS WAF doesn't automatically update the metric name when you update the rule name.
*/
@JvmName("axsulxyhnyesgwjl")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The override action to apply to the rules in a rule group, instead of the individual rule action settings. This is used only for rules whose statements reference a rule group. Rule statements that reference a rule group are `RuleGroupReferenceStatement` and `ManagedRuleGroupStatement` .
* Set the override action to none to leave the rule group rule actions in effect. Set it to count to only count matches, regardless of the rule action settings.
* You must set either this `OverrideAction` setting or the `Action` setting, but not both:
* - If the rule statement references a rule group, you must set this override action setting and you must not set the rule's action setting.
* - If the rule statement doesn't reference a rule group, you must set the rule action setting and you must not set the rule's override action setting.
*/
@JvmName("savbjxcnqjhfwrjj")
public suspend fun overrideAction(`value`: Output) {
this.overrideAction = value
}
/**
* @param value If you define more than one `Rule` in a `WebACL` , AWS WAF evaluates each request against the `Rules` in order based on the value of `Priority` . AWS WAF processes rules with lower priority first. The priorities don't need to be consecutive, but they must all be different.
*/
@JvmName("jpthhlctlwhilheb")
public suspend fun priority(`value`: Output) {
this.priority = value
}
/**
* @param value Collection of Rule Labels.
*/
@JvmName("yuvybddweerfogsr")
public suspend fun ruleLabels(`value`: Output>) {
this.ruleLabels = value
}
@JvmName("gnvhuaqvdgyyqiey")
public suspend fun ruleLabels(vararg values: Output) {
this.ruleLabels = Output.all(values.asList())
}
/**
* @param values Collection of Rule Labels.
*/
@JvmName("yipjmfbugttewixp")
public suspend fun ruleLabels(values: List