![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.awsnative.wafv2.kotlin.outputs.RuleGroupRuleAction.kt Maven / Gradle / Ivy
@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 RuleGroupRuleAction(
public val allow: RuleGroupAllowAction? = null,
public val block: RuleGroupBlockAction? = null,
public val captcha: RuleGroupCaptchaAction? = null,
public val challenge: RuleGroupChallengeAction? = null,
public val count: RuleGroupCountAction? = null,
) {
public companion object {
public fun toKotlin(javaType: com.pulumi.awsnative.wafv2.outputs.RuleGroupRuleAction): RuleGroupRuleAction = RuleGroupRuleAction(
allow = javaType.allow().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.wafv2.kotlin.outputs.RuleGroupAllowAction.Companion.toKotlin(args0)
})
}).orElse(null),
block = javaType.block().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.wafv2.kotlin.outputs.RuleGroupBlockAction.Companion.toKotlin(args0)
})
}).orElse(null),
captcha = javaType.captcha().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.wafv2.kotlin.outputs.RuleGroupCaptchaAction.Companion.toKotlin(args0)
})
}).orElse(null),
challenge = javaType.challenge().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.wafv2.kotlin.outputs.RuleGroupChallengeAction.Companion.toKotlin(args0)
})
}).orElse(null),
count = javaType.count().map({ args0 ->
args0.let({ args0 ->
com.pulumi.awsnative.wafv2.kotlin.outputs.RuleGroupCountAction.Companion.toKotlin(args0)
})
}).orElse(null),
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy