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

com.pulumi.aws.wafv2.kotlin.inputs.WebAclRuleStatementRateBasedStatementArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.wafv2.kotlin.inputs

import com.pulumi.aws.wafv2.inputs.WebAclRuleStatementRateBasedStatementArgs.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

/**
 *
 * @property aggregateKeyType Setting that indicates how to aggregate the request counts. Valid values include: `CONSTANT`, `CUSTOM_KEYS`, `FORWARDED_IP`, or `IP`. Default: `IP`.
 * @property customKeys Aggregate the request counts using one or more web request components as the aggregate keys. See `custom_key` below for details.
 * @property evaluationWindowSec The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time. Valid values are `60`, `120`, `300`, and `600`. Defaults to `300` (5 minutes).
 * **NOTE:** This setting doesn't determine how often AWS WAF checks the rate, but how far back it looks each time it checks. AWS WAF checks the rate about every 10 seconds.
 * @property forwardedIpConfig Configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. If `aggregate_key_type` is set to `FORWARDED_IP`, this block is required. See `forwarded_ip_config` below for details.
 * @property limit Limit on requests per 5-minute period for a single originating IP address.
 * @property scopeDownStatement Optional nested statement that narrows the scope of the rate-based statement to matching web requests. This can be any nestable statement, and you can nest statements at any level below this scope-down statement. See `statement` above for details. If `aggregate_key_type` is set to `CONSTANT`, this block is required.
 */
public data class WebAclRuleStatementRateBasedStatementArgs(
    public val aggregateKeyType: Output? = null,
    public val customKeys: Output>? = null,
    public val evaluationWindowSec: Output? = null,
    public val forwardedIpConfig: Output? =
        null,
    public val limit: Output,
    public val scopeDownStatement: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.wafv2.inputs.WebAclRuleStatementRateBasedStatementArgs =
        com.pulumi.aws.wafv2.inputs.WebAclRuleStatementRateBasedStatementArgs.builder()
            .aggregateKeyType(aggregateKeyType?.applyValue({ args0 -> args0 }))
            .customKeys(
                customKeys?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .evaluationWindowSec(evaluationWindowSec?.applyValue({ args0 -> args0 }))
            .forwardedIpConfig(forwardedIpConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .limit(limit.applyValue({ args0 -> args0 }))
            .scopeDownStatement(
                scopeDownStatement?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [WebAclRuleStatementRateBasedStatementArgs].
 */
@PulumiTagMarker
public class WebAclRuleStatementRateBasedStatementArgsBuilder internal constructor() {
    private var aggregateKeyType: Output? = null

    private var customKeys: Output>? = null

    private var evaluationWindowSec: Output? = null

    private var forwardedIpConfig: Output? =
        null

    private var limit: Output? = null

    private var scopeDownStatement:
        Output? = null

    /**
     * @param value Setting that indicates how to aggregate the request counts. Valid values include: `CONSTANT`, `CUSTOM_KEYS`, `FORWARDED_IP`, or `IP`. Default: `IP`.
     */
    @JvmName("aeiajlhxahtvdqlm")
    public suspend fun aggregateKeyType(`value`: Output) {
        this.aggregateKeyType = value
    }

    /**
     * @param value Aggregate the request counts using one or more web request components as the aggregate keys. See `custom_key` below for details.
     */
    @JvmName("flqvcwhdqjfukpks")
    public suspend fun customKeys(`value`: Output>) {
        this.customKeys = value
    }

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

    /**
     * @param values Aggregate the request counts using one or more web request components as the aggregate keys. See `custom_key` below for details.
     */
    @JvmName("etkvtipclfqirnha")
    public suspend fun customKeys(values: List>) {
        this.customKeys = Output.all(values)
    }

    /**
     * @param value The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time. Valid values are `60`, `120`, `300`, and `600`. Defaults to `300` (5 minutes).
     * **NOTE:** This setting doesn't determine how often AWS WAF checks the rate, but how far back it looks each time it checks. AWS WAF checks the rate about every 10 seconds.
     */
    @JvmName("asqjqlsqicphbrpo")
    public suspend fun evaluationWindowSec(`value`: Output) {
        this.evaluationWindowSec = value
    }

    /**
     * @param value Configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. If `aggregate_key_type` is set to `FORWARDED_IP`, this block is required. See `forwarded_ip_config` below for details.
     */
    @JvmName("mmbbnxinthavaiga")
    public suspend fun forwardedIpConfig(`value`: Output) {
        this.forwardedIpConfig = value
    }

    /**
     * @param value Limit on requests per 5-minute period for a single originating IP address.
     */
    @JvmName("bdehrlheglgycpdw")
    public suspend fun limit(`value`: Output) {
        this.limit = value
    }

    /**
     * @param value Optional nested statement that narrows the scope of the rate-based statement to matching web requests. This can be any nestable statement, and you can nest statements at any level below this scope-down statement. See `statement` above for details. If `aggregate_key_type` is set to `CONSTANT`, this block is required.
     */
    @JvmName("ktljyvpojnknvkog")
    public suspend fun scopeDownStatement(`value`: Output) {
        this.scopeDownStatement = value
    }

    /**
     * @param value Setting that indicates how to aggregate the request counts. Valid values include: `CONSTANT`, `CUSTOM_KEYS`, `FORWARDED_IP`, or `IP`. Default: `IP`.
     */
    @JvmName("pnodepmshansgllm")
    public suspend fun aggregateKeyType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.aggregateKeyType = mapped
    }

    /**
     * @param value Aggregate the request counts using one or more web request components as the aggregate keys. See `custom_key` below for details.
     */
    @JvmName("xgyhfnwxwvggawou")
    public suspend fun customKeys(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customKeys = mapped
    }

    /**
     * @param argument Aggregate the request counts using one or more web request components as the aggregate keys. See `custom_key` below for details.
     */
    @JvmName("esrctrudyyybrnvy")
    public suspend fun customKeys(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            WebAclRuleStatementRateBasedStatementCustomKeyArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.customKeys = mapped
    }

    /**
     * @param argument Aggregate the request counts using one or more web request components as the aggregate keys. See `custom_key` below for details.
     */
    @JvmName("lbebcagryffbldeg")
    public suspend fun customKeys(vararg argument: suspend WebAclRuleStatementRateBasedStatementCustomKeyArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            WebAclRuleStatementRateBasedStatementCustomKeyArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.customKeys = mapped
    }

    /**
     * @param argument Aggregate the request counts using one or more web request components as the aggregate keys. See `custom_key` below for details.
     */
    @JvmName("luevguafqtwglqel")
    public suspend fun customKeys(argument: suspend WebAclRuleStatementRateBasedStatementCustomKeyArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            WebAclRuleStatementRateBasedStatementCustomKeyArgsBuilder().applySuspend
                { argument() }.build(),
        )
        val mapped = of(toBeMapped)
        this.customKeys = mapped
    }

    /**
     * @param values Aggregate the request counts using one or more web request components as the aggregate keys. See `custom_key` below for details.
     */
    @JvmName("xfgljaxvtofiunje")
    public suspend fun customKeys(vararg values: WebAclRuleStatementRateBasedStatementCustomKeyArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.customKeys = mapped
    }

    /**
     * @param value The amount of time, in seconds, that AWS WAF should include in its request counts, looking back from the current time. Valid values are `60`, `120`, `300`, and `600`. Defaults to `300` (5 minutes).
     * **NOTE:** This setting doesn't determine how often AWS WAF checks the rate, but how far back it looks each time it checks. AWS WAF checks the rate about every 10 seconds.
     */
    @JvmName("netjpbvnwriwkagd")
    public suspend fun evaluationWindowSec(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.evaluationWindowSec = mapped
    }

    /**
     * @param value Configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. If `aggregate_key_type` is set to `FORWARDED_IP`, this block is required. See `forwarded_ip_config` below for details.
     */
    @JvmName("wljfyfavlkiyjmmx")
    public suspend fun forwardedIpConfig(`value`: WebAclRuleStatementRateBasedStatementForwardedIpConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.forwardedIpConfig = mapped
    }

    /**
     * @param argument Configuration for inspecting IP addresses in an HTTP header that you specify, instead of using the IP address that's reported by the web request origin. If `aggregate_key_type` is set to `FORWARDED_IP`, this block is required. See `forwarded_ip_config` below for details.
     */
    @JvmName("cclxmjusotijvqcx")
    public suspend fun forwardedIpConfig(argument: suspend WebAclRuleStatementRateBasedStatementForwardedIpConfigArgsBuilder.() -> Unit) {
        val toBeMapped =
            WebAclRuleStatementRateBasedStatementForwardedIpConfigArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.forwardedIpConfig = mapped
    }

    /**
     * @param value Limit on requests per 5-minute period for a single originating IP address.
     */
    @JvmName("xaecoqfjjstfabhj")
    public suspend fun limit(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.limit = mapped
    }

    /**
     * @param value Optional nested statement that narrows the scope of the rate-based statement to matching web requests. This can be any nestable statement, and you can nest statements at any level below this scope-down statement. See `statement` above for details. If `aggregate_key_type` is set to `CONSTANT`, this block is required.
     */
    @JvmName("ehgvydaepjocsfbi")
    public suspend fun scopeDownStatement(`value`: WebAclRuleStatementRateBasedStatementScopeDownStatementArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scopeDownStatement = mapped
    }

    /**
     * @param argument Optional nested statement that narrows the scope of the rate-based statement to matching web requests. This can be any nestable statement, and you can nest statements at any level below this scope-down statement. See `statement` above for details. If `aggregate_key_type` is set to `CONSTANT`, this block is required.
     */
    @JvmName("unakefuflvujueoi")
    public suspend fun scopeDownStatement(argument: suspend WebAclRuleStatementRateBasedStatementScopeDownStatementArgsBuilder.() -> Unit) {
        val toBeMapped =
            WebAclRuleStatementRateBasedStatementScopeDownStatementArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.scopeDownStatement = mapped
    }

    internal fun build(): WebAclRuleStatementRateBasedStatementArgs =
        WebAclRuleStatementRateBasedStatementArgs(
            aggregateKeyType = aggregateKeyType,
            customKeys = customKeys,
            evaluationWindowSec = evaluationWindowSec,
            forwardedIpConfig = forwardedIpConfig,
            limit = limit ?: throw PulumiNullFieldException("limit"),
            scopeDownStatement = scopeDownStatement,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy