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

com.pulumi.cloudflare.kotlin.inputs.RulesetRuleRatelimitArgs.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: 5.40.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin.inputs

import com.pulumi.cloudflare.inputs.RulesetRuleRatelimitArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property characteristics List of parameters that define how Cloudflare tracks the request rate for this rule.
 * @property countingExpression Criteria for counting HTTP requests to trigger the Rate Limiting action. Uses the Firewall Rules expression language based on Wireshark display filters. Refer to the [Firewall Rules language](https://developers.cloudflare.com/firewall/cf-firewall-language) documentation for all available fields, operators, and functions.
 * @property mitigationTimeout Once the request rate is reached, the Rate Limiting rule blocks further requests for the period of time defined in this field.
 * @property period The period of time to consider (in seconds) when evaluating the request rate.
 * @property requestsPerPeriod The number of requests over the period of time that will trigger the Rate Limiting rule.
 * @property requestsToOrigin Whether to include requests to origin within the Rate Limiting count.
 * @property scorePerPeriod The maximum aggregate score over the period of time that will trigger Rate Limiting rule.
 * @property scoreResponseHeaderName Name of HTTP header in the response, set by the origin server, with the score for the current request.
 */
public data class RulesetRuleRatelimitArgs(
    public val characteristics: Output>? = null,
    public val countingExpression: Output? = null,
    public val mitigationTimeout: Output? = null,
    public val period: Output? = null,
    public val requestsPerPeriod: Output? = null,
    public val requestsToOrigin: Output? = null,
    public val scorePerPeriod: Output? = null,
    public val scoreResponseHeaderName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.inputs.RulesetRuleRatelimitArgs =
        com.pulumi.cloudflare.inputs.RulesetRuleRatelimitArgs.builder()
            .characteristics(characteristics?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .countingExpression(countingExpression?.applyValue({ args0 -> args0 }))
            .mitigationTimeout(mitigationTimeout?.applyValue({ args0 -> args0 }))
            .period(period?.applyValue({ args0 -> args0 }))
            .requestsPerPeriod(requestsPerPeriod?.applyValue({ args0 -> args0 }))
            .requestsToOrigin(requestsToOrigin?.applyValue({ args0 -> args0 }))
            .scorePerPeriod(scorePerPeriod?.applyValue({ args0 -> args0 }))
            .scoreResponseHeaderName(scoreResponseHeaderName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RulesetRuleRatelimitArgs].
 */
@PulumiTagMarker
public class RulesetRuleRatelimitArgsBuilder internal constructor() {
    private var characteristics: Output>? = null

    private var countingExpression: Output? = null

    private var mitigationTimeout: Output? = null

    private var period: Output? = null

    private var requestsPerPeriod: Output? = null

    private var requestsToOrigin: Output? = null

    private var scorePerPeriod: Output? = null

    private var scoreResponseHeaderName: Output? = null

    /**
     * @param value List of parameters that define how Cloudflare tracks the request rate for this rule.
     */
    @JvmName("qqwkabrluhlyhpjm")
    public suspend fun characteristics(`value`: Output>) {
        this.characteristics = value
    }

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

    /**
     * @param values List of parameters that define how Cloudflare tracks the request rate for this rule.
     */
    @JvmName("rhujefwclkukwlqx")
    public suspend fun characteristics(values: List>) {
        this.characteristics = Output.all(values)
    }

    /**
     * @param value Criteria for counting HTTP requests to trigger the Rate Limiting action. Uses the Firewall Rules expression language based on Wireshark display filters. Refer to the [Firewall Rules language](https://developers.cloudflare.com/firewall/cf-firewall-language) documentation for all available fields, operators, and functions.
     */
    @JvmName("cxkcswwuwfsoijyp")
    public suspend fun countingExpression(`value`: Output) {
        this.countingExpression = value
    }

    /**
     * @param value Once the request rate is reached, the Rate Limiting rule blocks further requests for the period of time defined in this field.
     */
    @JvmName("idjcjxykadqlllhc")
    public suspend fun mitigationTimeout(`value`: Output) {
        this.mitigationTimeout = value
    }

    /**
     * @param value The period of time to consider (in seconds) when evaluating the request rate.
     */
    @JvmName("cjdtwufgvusbuuot")
    public suspend fun period(`value`: Output) {
        this.period = value
    }

    /**
     * @param value The number of requests over the period of time that will trigger the Rate Limiting rule.
     */
    @JvmName("hxomoocpfpfejrgs")
    public suspend fun requestsPerPeriod(`value`: Output) {
        this.requestsPerPeriod = value
    }

    /**
     * @param value Whether to include requests to origin within the Rate Limiting count.
     */
    @JvmName("lknbravgpgwkxvhd")
    public suspend fun requestsToOrigin(`value`: Output) {
        this.requestsToOrigin = value
    }

    /**
     * @param value The maximum aggregate score over the period of time that will trigger Rate Limiting rule.
     */
    @JvmName("ciqildobufioruui")
    public suspend fun scorePerPeriod(`value`: Output) {
        this.scorePerPeriod = value
    }

    /**
     * @param value Name of HTTP header in the response, set by the origin server, with the score for the current request.
     */
    @JvmName("ssmwpbehsugbgnec")
    public suspend fun scoreResponseHeaderName(`value`: Output) {
        this.scoreResponseHeaderName = value
    }

    /**
     * @param value List of parameters that define how Cloudflare tracks the request rate for this rule.
     */
    @JvmName("apmomuqrnwgdlvjk")
    public suspend fun characteristics(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.characteristics = mapped
    }

    /**
     * @param values List of parameters that define how Cloudflare tracks the request rate for this rule.
     */
    @JvmName("pxodboxmbpcdtekx")
    public suspend fun characteristics(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.characteristics = mapped
    }

    /**
     * @param value Criteria for counting HTTP requests to trigger the Rate Limiting action. Uses the Firewall Rules expression language based on Wireshark display filters. Refer to the [Firewall Rules language](https://developers.cloudflare.com/firewall/cf-firewall-language) documentation for all available fields, operators, and functions.
     */
    @JvmName("xawtgnlyxjtfjnhd")
    public suspend fun countingExpression(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.countingExpression = mapped
    }

    /**
     * @param value Once the request rate is reached, the Rate Limiting rule blocks further requests for the period of time defined in this field.
     */
    @JvmName("mawrhyndampkyeid")
    public suspend fun mitigationTimeout(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.mitigationTimeout = mapped
    }

    /**
     * @param value The period of time to consider (in seconds) when evaluating the request rate.
     */
    @JvmName("bualjcvdfuotmktj")
    public suspend fun period(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.period = mapped
    }

    /**
     * @param value The number of requests over the period of time that will trigger the Rate Limiting rule.
     */
    @JvmName("vghvpdjlmrmemfke")
    public suspend fun requestsPerPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestsPerPeriod = mapped
    }

    /**
     * @param value Whether to include requests to origin within the Rate Limiting count.
     */
    @JvmName("tirkuqeoavdwhqoh")
    public suspend fun requestsToOrigin(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestsToOrigin = mapped
    }

    /**
     * @param value The maximum aggregate score over the period of time that will trigger Rate Limiting rule.
     */
    @JvmName("pyktiqjpwbokhrsb")
    public suspend fun scorePerPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scorePerPeriod = mapped
    }

    /**
     * @param value Name of HTTP header in the response, set by the origin server, with the score for the current request.
     */
    @JvmName("glmfnjsqnnsfnwlw")
    public suspend fun scoreResponseHeaderName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scoreResponseHeaderName = mapped
    }

    internal fun build(): RulesetRuleRatelimitArgs = RulesetRuleRatelimitArgs(
        characteristics = characteristics,
        countingExpression = countingExpression,
        mitigationTimeout = mitigationTimeout,
        period = period,
        requestsPerPeriod = requestsPerPeriod,
        requestsToOrigin = requestsToOrigin,
        scorePerPeriod = scorePerPeriod,
        scoreResponseHeaderName = scoreResponseHeaderName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy