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

com.pulumi.awsnative.wafv2.kotlin.inputs.RuleGroupRuleArgs.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: 1.11.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.wafv2.kotlin.inputs

import com.pulumi.awsnative.wafv2.inputs.RuleGroupRuleArgs.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 RuleGroup that contains condition and action.
 * @property action The action that AWS WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.
 * @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 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 RuleGroupRuleArgs(
    public val action: Output? = null,
    public val captchaConfig: Output? = null,
    public val challengeConfig: Output? = null,
    public val name: Output,
    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.RuleGroupRuleArgs =
        com.pulumi.awsnative.wafv2.inputs.RuleGroupRuleArgs.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 }))
            .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 [RuleGroupRuleArgs].
 */
@PulumiTagMarker
public class RuleGroupRuleArgsBuilder internal constructor() {
    private var action: Output? = null

    private var captchaConfig: Output? = null

    private var challengeConfig: Output? = null

    private var name: 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 statement. Settings at the web ACL level can override the rule action setting.
     */
    @JvmName("icgxptfirewgjkcx")
    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("qbcmvufsudiakyih")
    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("rxkvotkmprvwhesh")
    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("fevxnfcnccvfvbvv")
    public suspend fun name(`value`: Output) {
        this.name = 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("oyalvmpprnahiauk")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value Collection of Rule Labels.
     */
    @JvmName("hvhhprugebxuxaxg")
    public suspend fun ruleLabels(`value`: Output>) {
        this.ruleLabels = value
    }

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

    /**
     * @param values Collection of Rule Labels.
     */
    @JvmName("idvwuvedjqpmigrd")
    public suspend fun ruleLabels(values: List>) {
        this.ruleLabels = Output.all(values)
    }

    /**
     * @param value The AWS WAF processing statement for the rule, for example `ByteMatchStatement` or `SizeConstraintStatement` .
     */
    @JvmName("mjgnfwgcwemvijsj")
    public suspend fun statement(`value`: Output) {
        this.statement = value
    }

    /**
     * @param value 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.
     */
    @JvmName("neokukqysusvdopq")
    public suspend fun visibilityConfig(`value`: Output) {
        this.visibilityConfig = value
    }

    /**
     * @param value The action that AWS WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.
     */
    @JvmName("yhtursuismsrujgv")
    public suspend fun action(`value`: RuleGroupRuleActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.action = mapped
    }

    /**
     * @param argument The action that AWS WAF should take on a web request when it matches the rule statement. Settings at the web ACL level can override the rule action setting.
     */
    @JvmName("aytpghnoaqhkrfdo")
    public suspend fun action(argument: suspend RuleGroupRuleActionArgsBuilder.() -> Unit) {
        val toBeMapped = RuleGroupRuleActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.action = mapped
    }

    /**
     * @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("najchtupcykflulv")
    public suspend fun captchaConfig(`value`: RuleGroupCaptchaConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.captchaConfig = mapped
    }

    /**
     * @param argument 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("bommhlenleqxfxog")
    public suspend fun captchaConfig(argument: suspend RuleGroupCaptchaConfigArgsBuilder.() -> Unit) {
        val toBeMapped = RuleGroupCaptchaConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.captchaConfig = mapped
    }

    /**
     * @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("dmfbpxjtujblrgpx")
    public suspend fun challengeConfig(`value`: RuleGroupChallengeConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.challengeConfig = mapped
    }

    /**
     * @param argument 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("odfdrixlaoefkabd")
    public suspend fun challengeConfig(argument: suspend RuleGroupChallengeConfigArgsBuilder.() -> Unit) {
        val toBeMapped = RuleGroupChallengeConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.challengeConfig = mapped
    }

    /**
     * @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("aqwicjhtnsioloiq")
    public suspend fun name(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @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("awdnovbeyyxufume")
    public suspend fun priority(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value Collection of Rule Labels.
     */
    @JvmName("oodfdwdepcdlwsva")
    public suspend fun ruleLabels(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleLabels = mapped
    }

    /**
     * @param argument Collection of Rule Labels.
     */
    @JvmName("dxdnvdwqghgorxfy")
    public suspend fun ruleLabels(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RuleGroupLabelArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.ruleLabels = mapped
    }

    /**
     * @param argument Collection of Rule Labels.
     */
    @JvmName("lkisidvkoncidicm")
    public suspend fun ruleLabels(vararg argument: suspend RuleGroupLabelArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RuleGroupLabelArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.ruleLabels = mapped
    }

    /**
     * @param argument Collection of Rule Labels.
     */
    @JvmName("tjqejbqqmbxfuefx")
    public suspend fun ruleLabels(argument: suspend RuleGroupLabelArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(RuleGroupLabelArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.ruleLabels = mapped
    }

    /**
     * @param values Collection of Rule Labels.
     */
    @JvmName("fgjgibeuqkwumfxe")
    public suspend fun ruleLabels(vararg values: RuleGroupLabelArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ruleLabels = mapped
    }

    /**
     * @param value The AWS WAF processing statement for the rule, for example `ByteMatchStatement` or `SizeConstraintStatement` .
     */
    @JvmName("ycnjatwynfaqigsd")
    public suspend fun statement(`value`: RuleGroupStatementArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.statement = mapped
    }

    /**
     * @param argument The AWS WAF processing statement for the rule, for example `ByteMatchStatement` or `SizeConstraintStatement` .
     */
    @JvmName("uwdrawvoxxndnbcm")
    public suspend fun statement(argument: suspend RuleGroupStatementArgsBuilder.() -> Unit) {
        val toBeMapped = RuleGroupStatementArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.statement = mapped
    }

    /**
     * @param value 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.
     */
    @JvmName("lwhcfhcxqmmdjtai")
    public suspend fun visibilityConfig(`value`: RuleGroupVisibilityConfigArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.visibilityConfig = mapped
    }

    /**
     * @param argument 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.
     */
    @JvmName("eofdcudfnyqmloby")
    public suspend fun visibilityConfig(argument: suspend RuleGroupVisibilityConfigArgsBuilder.() -> Unit) {
        val toBeMapped = RuleGroupVisibilityConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.visibilityConfig = mapped
    }

    internal fun build(): RuleGroupRuleArgs = RuleGroupRuleArgs(
        action = action,
        captchaConfig = captchaConfig,
        challengeConfig = challengeConfig,
        name = name ?: throw PulumiNullFieldException("name"),
        priority = priority ?: throw PulumiNullFieldException("priority"),
        ruleLabels = ruleLabels,
        statement = statement ?: throw PulumiNullFieldException("statement"),
        visibilityConfig = visibilityConfig ?: throw PulumiNullFieldException("visibilityConfig"),
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy