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

com.pulumi.awsnative.wafv2.kotlin.inputs.WebAclRuleActionArgs.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.WebAclRuleActionArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Action taken when Rule matches its condition.
 * @property allow Instructs AWS WAF to allow the web request.
 * @property block Instructs AWS WAF to block the web request.
 * @property captcha Specifies that AWS WAF should run a `CAPTCHA` check against the request:
 * - If the request includes a valid, unexpired `CAPTCHA` token, AWS WAF allows the web request inspection to proceed to the next rule, similar to a `CountAction` .
 * - If the request doesn't include a valid, unexpired `CAPTCHA` token, AWS WAF discontinues the web ACL evaluation of the request and blocks it from going to its intended destination.
 * AWS WAF generates a response that it sends back to the client, which includes the following:
 * - The header `x-amzn-waf-action` with a value of `captcha` .
 * - The HTTP status code `405 Method Not Allowed` .
 * - If the request contains an `Accept` header with a value of `text/html` , the response includes a `CAPTCHA` challenge.
 * You can configure the expiration time in the `CaptchaConfig` `ImmunityTimeProperty` setting at the rule and web ACL level. The rule setting overrides the web ACL setting.
 * This action option is available for rules. It isn't available for web ACL default actions.
 * @property challenge Instructs AWS WAF to run a `Challenge` check against the web request.
 * @property count Instructs AWS WAF to count the web request and then continue evaluating the request using the remaining rules in the web ACL.
 */
public data class WebAclRuleActionArgs(
    public val allow: Output? = null,
    public val block: Output? = null,
    public val captcha: Output? = null,
    public val challenge: Output? = null,
    public val count: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.wafv2.inputs.WebAclRuleActionArgs =
        com.pulumi.awsnative.wafv2.inputs.WebAclRuleActionArgs.builder()
            .allow(allow?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .block(block?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .captcha(captcha?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .challenge(challenge?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .count(count?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

/**
 * Builder for [WebAclRuleActionArgs].
 */
@PulumiTagMarker
public class WebAclRuleActionArgsBuilder internal constructor() {
    private var allow: Output? = null

    private var block: Output? = null

    private var captcha: Output? = null

    private var challenge: Output? = null

    private var count: Output? = null

    /**
     * @param value Instructs AWS WAF to allow the web request.
     */
    @JvmName("rxkfwdbyudlgylji")
    public suspend fun allow(`value`: Output) {
        this.allow = value
    }

    /**
     * @param value Instructs AWS WAF to block the web request.
     */
    @JvmName("mwjhbpwuqgttqopc")
    public suspend fun block(`value`: Output) {
        this.block = value
    }

    /**
     * @param value Specifies that AWS WAF should run a `CAPTCHA` check against the request:
     * - If the request includes a valid, unexpired `CAPTCHA` token, AWS WAF allows the web request inspection to proceed to the next rule, similar to a `CountAction` .
     * - If the request doesn't include a valid, unexpired `CAPTCHA` token, AWS WAF discontinues the web ACL evaluation of the request and blocks it from going to its intended destination.
     * AWS WAF generates a response that it sends back to the client, which includes the following:
     * - The header `x-amzn-waf-action` with a value of `captcha` .
     * - The HTTP status code `405 Method Not Allowed` .
     * - If the request contains an `Accept` header with a value of `text/html` , the response includes a `CAPTCHA` challenge.
     * You can configure the expiration time in the `CaptchaConfig` `ImmunityTimeProperty` setting at the rule and web ACL level. The rule setting overrides the web ACL setting.
     * This action option is available for rules. It isn't available for web ACL default actions.
     */
    @JvmName("yosgmidobqqlwodv")
    public suspend fun captcha(`value`: Output) {
        this.captcha = value
    }

    /**
     * @param value Instructs AWS WAF to run a `Challenge` check against the web request.
     */
    @JvmName("iuinscldoomquxuq")
    public suspend fun challenge(`value`: Output) {
        this.challenge = value
    }

    /**
     * @param value Instructs AWS WAF to count the web request and then continue evaluating the request using the remaining rules in the web ACL.
     */
    @JvmName("rsduswgmyasgcuye")
    public suspend fun count(`value`: Output) {
        this.count = value
    }

    /**
     * @param value Instructs AWS WAF to allow the web request.
     */
    @JvmName("mtcwgxkaaslreofq")
    public suspend fun allow(`value`: WebAclAllowActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.allow = mapped
    }

    /**
     * @param argument Instructs AWS WAF to allow the web request.
     */
    @JvmName("yynyiulxrfxstcnx")
    public suspend fun allow(argument: suspend WebAclAllowActionArgsBuilder.() -> Unit) {
        val toBeMapped = WebAclAllowActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.allow = mapped
    }

    /**
     * @param value Instructs AWS WAF to block the web request.
     */
    @JvmName("yovdotserpnosbop")
    public suspend fun block(`value`: WebAclBlockActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.block = mapped
    }

    /**
     * @param argument Instructs AWS WAF to block the web request.
     */
    @JvmName("psoxnulhiernhlbe")
    public suspend fun block(argument: suspend WebAclBlockActionArgsBuilder.() -> Unit) {
        val toBeMapped = WebAclBlockActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.block = mapped
    }

    /**
     * @param value Specifies that AWS WAF should run a `CAPTCHA` check against the request:
     * - If the request includes a valid, unexpired `CAPTCHA` token, AWS WAF allows the web request inspection to proceed to the next rule, similar to a `CountAction` .
     * - If the request doesn't include a valid, unexpired `CAPTCHA` token, AWS WAF discontinues the web ACL evaluation of the request and blocks it from going to its intended destination.
     * AWS WAF generates a response that it sends back to the client, which includes the following:
     * - The header `x-amzn-waf-action` with a value of `captcha` .
     * - The HTTP status code `405 Method Not Allowed` .
     * - If the request contains an `Accept` header with a value of `text/html` , the response includes a `CAPTCHA` challenge.
     * You can configure the expiration time in the `CaptchaConfig` `ImmunityTimeProperty` setting at the rule and web ACL level. The rule setting overrides the web ACL setting.
     * This action option is available for rules. It isn't available for web ACL default actions.
     */
    @JvmName("ddtritjqwtshveix")
    public suspend fun captcha(`value`: WebAclCaptchaActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.captcha = mapped
    }

    /**
     * @param argument Specifies that AWS WAF should run a `CAPTCHA` check against the request:
     * - If the request includes a valid, unexpired `CAPTCHA` token, AWS WAF allows the web request inspection to proceed to the next rule, similar to a `CountAction` .
     * - If the request doesn't include a valid, unexpired `CAPTCHA` token, AWS WAF discontinues the web ACL evaluation of the request and blocks it from going to its intended destination.
     * AWS WAF generates a response that it sends back to the client, which includes the following:
     * - The header `x-amzn-waf-action` with a value of `captcha` .
     * - The HTTP status code `405 Method Not Allowed` .
     * - If the request contains an `Accept` header with a value of `text/html` , the response includes a `CAPTCHA` challenge.
     * You can configure the expiration time in the `CaptchaConfig` `ImmunityTimeProperty` setting at the rule and web ACL level. The rule setting overrides the web ACL setting.
     * This action option is available for rules. It isn't available for web ACL default actions.
     */
    @JvmName("prjviqrsmxnodxpk")
    public suspend fun captcha(argument: suspend WebAclCaptchaActionArgsBuilder.() -> Unit) {
        val toBeMapped = WebAclCaptchaActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.captcha = mapped
    }

    /**
     * @param value Instructs AWS WAF to run a `Challenge` check against the web request.
     */
    @JvmName("msbrbkoyllmsrykr")
    public suspend fun challenge(`value`: WebAclChallengeActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.challenge = mapped
    }

    /**
     * @param argument Instructs AWS WAF to run a `Challenge` check against the web request.
     */
    @JvmName("irqvevxdbnhoudkw")
    public suspend fun challenge(argument: suspend WebAclChallengeActionArgsBuilder.() -> Unit) {
        val toBeMapped = WebAclChallengeActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.challenge = mapped
    }

    /**
     * @param value Instructs AWS WAF to count the web request and then continue evaluating the request using the remaining rules in the web ACL.
     */
    @JvmName("pdqpfawbsnkknnmo")
    public suspend fun count(`value`: WebAclCountActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.count = mapped
    }

    /**
     * @param argument Instructs AWS WAF to count the web request and then continue evaluating the request using the remaining rules in the web ACL.
     */
    @JvmName("pkyalceyftmkskxw")
    public suspend fun count(argument: suspend WebAclCountActionArgsBuilder.() -> Unit) {
        val toBeMapped = WebAclCountActionArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.count = mapped
    }

    internal fun build(): WebAclRuleActionArgs = WebAclRuleActionArgs(
        allow = allow,
        block = block,
        captcha = captcha,
        challenge = challenge,
        count = count,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy