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

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

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

import com.pulumi.aws.wafv2.inputs.RuleGroupRuleStatementRateBasedStatementArgs.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 The 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 The limit on requests per 5-minute period for a single originating IP address.
 * @property scopeDownStatement An 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 RuleGroupRuleStatementRateBasedStatementArgs(
    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.RuleGroupRuleStatementRateBasedStatementArgs =
        com.pulumi.aws.wafv2.inputs.RuleGroupRuleStatementRateBasedStatementArgs.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 [RuleGroupRuleStatementRateBasedStatementArgs].
 */
@PulumiTagMarker
public class RuleGroupRuleStatementRateBasedStatementArgsBuilder 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("polgbnugsndhpbof")
    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("euidihcpbiioewcx")
    public suspend fun customKeys(`value`: Output>) {
        this.customKeys = value
    }

    @JvmName("aanncwbcjeinlsxu")
    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("qfqqnpaynpydbiav")
    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("lekatkmclvwwykrb")
    public suspend fun evaluationWindowSec(`value`: Output) {
        this.evaluationWindowSec = value
    }

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

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

    /**
     * @param value An 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("sqfajkmepiwqmoek")
    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("fogeevwpvornpool")
    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("otpijcyeupsynyrx")
    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("jnviphnfcrcjgkji")
    public suspend fun customKeys(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RuleGroupRuleStatementRateBasedStatementCustomKeyArgsBuilder().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("xetdkojjrecyijyg")
    public suspend fun customKeys(vararg argument: suspend RuleGroupRuleStatementRateBasedStatementCustomKeyArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RuleGroupRuleStatementRateBasedStatementCustomKeyArgsBuilder().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("nxeyvvtlcvhwfnrr")
    public suspend fun customKeys(argument: suspend RuleGroupRuleStatementRateBasedStatementCustomKeyArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                RuleGroupRuleStatementRateBasedStatementCustomKeyArgsBuilder().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("sjdfijeyofnimvps")
    public suspend fun customKeys(vararg values: RuleGroupRuleStatementRateBasedStatementCustomKeyArgs) {
        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("ugcdtkierfmqeuug")
    public suspend fun evaluationWindowSec(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.evaluationWindowSec = mapped
    }

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy