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

com.pulumi.aws.wafregional.kotlin.inputs.WebAclRuleArgs.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: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.wafregional.kotlin.inputs

import com.pulumi.aws.wafregional.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.jvm.JvmName

/**
 *
 * @property action Configuration block of the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.  Not used if `type` is `GROUP`. Detailed below.
 * @property overrideAction Configuration block of the override the action that a group requests CloudFront or AWS WAF takes when a web request matches the conditions in the rule.  Only used if `type` is `GROUP`. Detailed below.
 * @property priority Specifies the order in which the rules in a WebACL are evaluated.
 * Rules with a lower value are evaluated before rules with a higher value.
 * @property ruleId ID of the associated WAF (Regional) rule (e.g., `aws.wafregional.Rule`). WAF (Global) rules cannot be used.
 * @property type The rule type, either `REGULAR`, as defined by [Rule](http://docs.aws.amazon.com/waf/latest/APIReference/API_Rule.html), `RATE_BASED`, as defined by [RateBasedRule](http://docs.aws.amazon.com/waf/latest/APIReference/API_RateBasedRule.html), or `GROUP`, as defined by [RuleGroup](https://docs.aws.amazon.com/waf/latest/APIReference/API_RuleGroup.html). The default is REGULAR. If you add a RATE_BASED rule, you need to set `type` as `RATE_BASED`. If you add a GROUP rule, you need to set `type` as `GROUP`.
 */
public data class WebAclRuleArgs(
    public val action: Output? = null,
    public val overrideAction: Output? = null,
    public val priority: Output,
    public val ruleId: Output,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.wafregional.inputs.WebAclRuleArgs =
        com.pulumi.aws.wafregional.inputs.WebAclRuleArgs.builder()
            .action(action?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .overrideAction(overrideAction?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .priority(priority.applyValue({ args0 -> args0 }))
            .ruleId(ruleId.applyValue({ args0 -> args0 }))
            .type(type?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [WebAclRuleArgs].
 */
@PulumiTagMarker
public class WebAclRuleArgsBuilder internal constructor() {
    private var action: Output? = null

    private var overrideAction: Output? = null

    private var priority: Output? = null

    private var ruleId: Output? = null

    private var type: Output? = null

    /**
     * @param value Configuration block of the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.  Not used if `type` is `GROUP`. Detailed below.
     */
    @JvmName("howlydarspehffvi")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value Configuration block of the override the action that a group requests CloudFront or AWS WAF takes when a web request matches the conditions in the rule.  Only used if `type` is `GROUP`. Detailed below.
     */
    @JvmName("crfwxbmwgpjgtdje")
    public suspend fun overrideAction(`value`: Output) {
        this.overrideAction = value
    }

    /**
     * @param value Specifies the order in which the rules in a WebACL are evaluated.
     * Rules with a lower value are evaluated before rules with a higher value.
     */
    @JvmName("gnatxofxoiiuwkve")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value ID of the associated WAF (Regional) rule (e.g., `aws.wafregional.Rule`). WAF (Global) rules cannot be used.
     */
    @JvmName("jdrfirelbrbytqpt")
    public suspend fun ruleId(`value`: Output) {
        this.ruleId = value
    }

    /**
     * @param value The rule type, either `REGULAR`, as defined by [Rule](http://docs.aws.amazon.com/waf/latest/APIReference/API_Rule.html), `RATE_BASED`, as defined by [RateBasedRule](http://docs.aws.amazon.com/waf/latest/APIReference/API_RateBasedRule.html), or `GROUP`, as defined by [RuleGroup](https://docs.aws.amazon.com/waf/latest/APIReference/API_RuleGroup.html). The default is REGULAR. If you add a RATE_BASED rule, you need to set `type` as `RATE_BASED`. If you add a GROUP rule, you need to set `type` as `GROUP`.
     */
    @JvmName("pmraipabhaltvntn")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value Configuration block of the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.  Not used if `type` is `GROUP`. Detailed below.
     */
    @JvmName("sywqhecqejpgylgb")
    public suspend fun action(`value`: WebAclRuleActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param argument Configuration block of the action that CloudFront or AWS WAF takes when a web request matches the conditions in the rule.  Not used if `type` is `GROUP`. Detailed below.
     */
    @JvmName("shqxwlgghfjnikkj")
    public suspend fun action(argument: suspend WebAclRuleActionArgsBuilder.() -> Unit) {
        val toBeMapped = WebAclRuleActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.action = mapped
    }

    /**
     * @param value Configuration block of the override the action that a group requests CloudFront or AWS WAF takes when a web request matches the conditions in the rule.  Only used if `type` is `GROUP`. Detailed below.
     */
    @JvmName("rciqgeulpifpjeer")
    public suspend fun overrideAction(`value`: WebAclRuleOverrideActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.overrideAction = mapped
    }

    /**
     * @param argument Configuration block of the override the action that a group requests CloudFront or AWS WAF takes when a web request matches the conditions in the rule.  Only used if `type` is `GROUP`. Detailed below.
     */
    @JvmName("hunxkmgapbhttyqa")
    public suspend fun overrideAction(argument: suspend WebAclRuleOverrideActionArgsBuilder.() -> Unit) {
        val toBeMapped = WebAclRuleOverrideActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.overrideAction = mapped
    }

    /**
     * @param value Specifies the order in which the rules in a WebACL are evaluated.
     * Rules with a lower value are evaluated before rules with a higher value.
     */
    @JvmName("pobexhmbdiidetgq")
    public suspend fun priority(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value ID of the associated WAF (Regional) rule (e.g., `aws.wafregional.Rule`). WAF (Global) rules cannot be used.
     */
    @JvmName("celbsbocgatpjymp")
    public suspend fun ruleId(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ruleId = mapped
    }

    /**
     * @param value The rule type, either `REGULAR`, as defined by [Rule](http://docs.aws.amazon.com/waf/latest/APIReference/API_Rule.html), `RATE_BASED`, as defined by [RateBasedRule](http://docs.aws.amazon.com/waf/latest/APIReference/API_RateBasedRule.html), or `GROUP`, as defined by [RuleGroup](https://docs.aws.amazon.com/waf/latest/APIReference/API_RuleGroup.html). The default is REGULAR. If you add a RATE_BASED rule, you need to set `type` as `RATE_BASED`. If you add a GROUP rule, you need to set `type` as `GROUP`.
     */
    @JvmName("pedhcqltaxejtsfn")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): WebAclRuleArgs = WebAclRuleArgs(
        action = action,
        overrideAction = overrideAction,
        priority = priority ?: throw PulumiNullFieldException("priority"),
        ruleId = ruleId ?: throw PulumiNullFieldException("ruleId"),
        type = type,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy