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

com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclRuleAction.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.outputs

import kotlin.Suppress

/**
 * 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 WebAclRuleAction(
    public val allow: WebAclAllowAction? = null,
    public val block: WebAclBlockAction? = null,
    public val captcha: WebAclCaptchaAction? = null,
    public val challenge: WebAclChallengeAction? = null,
    public val count: WebAclCountAction? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.awsnative.wafv2.outputs.WebAclRuleAction): WebAclRuleAction = WebAclRuleAction(
            allow = javaType.allow().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclAllowAction.Companion.toKotlin(args0)
                })
            }).orElse(null),
            block = javaType.block().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclBlockAction.Companion.toKotlin(args0)
                })
            }).orElse(null),
            captcha = javaType.captcha().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclCaptchaAction.Companion.toKotlin(args0)
                })
            }).orElse(null),
            challenge = javaType.challenge().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclChallengeAction.Companion.toKotlin(args0)
                })
            }).orElse(null),
            count = javaType.count().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.awsnative.wafv2.kotlin.outputs.WebAclCountAction.Companion.toKotlin(args0)
                })
            }).orElse(null),
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy