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

com.pulumi.aws.wafv2.kotlin.RuleGroupArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.aws.wafv2.kotlin

import com.pulumi.aws.wafv2.RuleGroupArgs.builder
import com.pulumi.aws.wafv2.kotlin.inputs.RuleGroupCustomResponseBodyArgs
import com.pulumi.aws.wafv2.kotlin.inputs.RuleGroupCustomResponseBodyArgsBuilder
import com.pulumi.aws.wafv2.kotlin.inputs.RuleGroupRuleArgs
import com.pulumi.aws.wafv2.kotlin.inputs.RuleGroupRuleArgsBuilder
import com.pulumi.aws.wafv2.kotlin.inputs.RuleGroupVisibilityConfigArgs
import com.pulumi.aws.wafv2.kotlin.inputs.RuleGroupVisibilityConfigArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 *
 * @property capacity The web ACL capacity units (WCUs) required for this rule group. See [here](https://docs.aws.amazon.com/waf/latest/APIReference/API_CreateRuleGroup.html#API_CreateRuleGroup_RequestSyntax) for general information and [here](https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statements-list.html) for capacity specific information.
 * @property customResponseBodies Defines custom response bodies that can be referenced by `custom_response` actions. See Custom Response Body below for details.
 * @property description A friendly description of the rule group.
 * @property name A friendly name of the rule group.
 * @property namePrefix
 * @property rules The rule blocks used to identify the web requests that you want to `allow`, `block`, or `count`. See Rules below for details.
 * @property scope Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider.
 * @property tags An array of key:value pairs to associate with the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
 * @property visibilityConfig Defines and enables Amazon CloudWatch metrics and web request sample collection. See Visibility Configuration below for details.
 */
public data class RuleGroupArgs(
    public val capacity: Output? = null,
    public val customResponseBodies: Output>? = null,
    public val description: Output? = null,
    public val name: Output? = null,
    public val namePrefix: Output? = null,
    public val rules: Output>? = null,
    public val scope: Output? = null,
    public val tags: Output>? = null,
    public val visibilityConfig: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.wafv2.RuleGroupArgs =
        com.pulumi.aws.wafv2.RuleGroupArgs.builder()
            .capacity(capacity?.applyValue({ args0 -> args0 }))
            .customResponseBodies(
                customResponseBodies?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .description(description?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .namePrefix(namePrefix?.applyValue({ args0 -> args0 }))
            .rules(rules?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .scope(scope?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .visibilityConfig(
                visibilityConfig?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [RuleGroupArgs].
 */
@PulumiTagMarker
public class RuleGroupArgsBuilder internal constructor() {
    private var capacity: Output? = null

    private var customResponseBodies: Output>? = null

    private var description: Output? = null

    private var name: Output? = null

    private var namePrefix: Output? = null

    private var rules: Output>? = null

    private var scope: Output? = null

    private var tags: Output>? = null

    private var visibilityConfig: Output? = null

    /**
     * @param value The web ACL capacity units (WCUs) required for this rule group. See [here](https://docs.aws.amazon.com/waf/latest/APIReference/API_CreateRuleGroup.html#API_CreateRuleGroup_RequestSyntax) for general information and [here](https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statements-list.html) for capacity specific information.
     */
    @JvmName("upvefgrswsfptxrp")
    public suspend fun capacity(`value`: Output) {
        this.capacity = value
    }

    /**
     * @param value Defines custom response bodies that can be referenced by `custom_response` actions. See Custom Response Body below for details.
     */
    @JvmName("jlmbeovrqpbxhjse")
    public suspend fun customResponseBodies(`value`: Output>) {
        this.customResponseBodies = value
    }

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

    /**
     * @param values Defines custom response bodies that can be referenced by `custom_response` actions. See Custom Response Body below for details.
     */
    @JvmName("bxxmhoxexfkwjnxg")
    public suspend fun customResponseBodies(values: List>) {
        this.customResponseBodies = Output.all(values)
    }

    /**
     * @param value A friendly description of the rule group.
     */
    @JvmName("vnocqpdeslsrvfao")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value A friendly name of the rule group.
     */
    @JvmName("dsihwrsnjswpopjd")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value
     */
    @JvmName("imswxsbylwygetpj")
    public suspend fun namePrefix(`value`: Output) {
        this.namePrefix = value
    }

    /**
     * @param value The rule blocks used to identify the web requests that you want to `allow`, `block`, or `count`. See Rules below for details.
     */
    @JvmName("kfwgkxvgjutyunqg")
    public suspend fun rules(`value`: Output>) {
        this.rules = value
    }

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

    /**
     * @param values The rule blocks used to identify the web requests that you want to `allow`, `block`, or `count`. See Rules below for details.
     */
    @JvmName("yavohhnhqdjqsgnr")
    public suspend fun rules(values: List>) {
        this.rules = Output.all(values)
    }

    /**
     * @param value Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider.
     */
    @JvmName("abgigdhycvwxutia")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

    /**
     * @param value An array of key:value pairs to associate with the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("fwaiuphicqqaqldi")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Defines and enables Amazon CloudWatch metrics and web request sample collection. See Visibility Configuration below for details.
     */
    @JvmName("daxmhhhwhlmeeyny")
    public suspend fun visibilityConfig(`value`: Output) {
        this.visibilityConfig = value
    }

    /**
     * @param value The web ACL capacity units (WCUs) required for this rule group. See [here](https://docs.aws.amazon.com/waf/latest/APIReference/API_CreateRuleGroup.html#API_CreateRuleGroup_RequestSyntax) for general information and [here](https://docs.aws.amazon.com/waf/latest/developerguide/waf-rule-statements-list.html) for capacity specific information.
     */
    @JvmName("jvmcqhygbwwysjja")
    public suspend fun capacity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.capacity = mapped
    }

    /**
     * @param value Defines custom response bodies that can be referenced by `custom_response` actions. See Custom Response Body below for details.
     */
    @JvmName("unymbbtjhcwxfmxx")
    public suspend fun customResponseBodies(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customResponseBodies = mapped
    }

    /**
     * @param argument Defines custom response bodies that can be referenced by `custom_response` actions. See Custom Response Body below for details.
     */
    @JvmName("blxgxntawqevqsgl")
    public suspend fun customResponseBodies(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RuleGroupCustomResponseBodyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.customResponseBodies = mapped
    }

    /**
     * @param argument Defines custom response bodies that can be referenced by `custom_response` actions. See Custom Response Body below for details.
     */
    @JvmName("xtywaeurlaxwsstp")
    public suspend fun customResponseBodies(vararg argument: suspend RuleGroupCustomResponseBodyArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RuleGroupCustomResponseBodyArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.customResponseBodies = mapped
    }

    /**
     * @param argument Defines custom response bodies that can be referenced by `custom_response` actions. See Custom Response Body below for details.
     */
    @JvmName("vojuxiyomjtkeqbp")
    public suspend fun customResponseBodies(argument: suspend RuleGroupCustomResponseBodyArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            RuleGroupCustomResponseBodyArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.customResponseBodies = mapped
    }

    /**
     * @param values Defines custom response bodies that can be referenced by `custom_response` actions. See Custom Response Body below for details.
     */
    @JvmName("iqmfphganulcfwxm")
    public suspend fun customResponseBodies(vararg values: RuleGroupCustomResponseBodyArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.customResponseBodies = mapped
    }

    /**
     * @param value A friendly description of the rule group.
     */
    @JvmName("onkxwlbhsqcjrflh")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value A friendly name of the rule group.
     */
    @JvmName("mryvpctftfeplwfg")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value
     */
    @JvmName("ykuypmgfpqepboes")
    public suspend fun namePrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namePrefix = mapped
    }

    /**
     * @param value The rule blocks used to identify the web requests that you want to `allow`, `block`, or `count`. See Rules below for details.
     */
    @JvmName("bcwgflbptvanvmxn")
    public suspend fun rules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param argument The rule blocks used to identify the web requests that you want to `allow`, `block`, or `count`. See Rules below for details.
     */
    @JvmName("vdwyvkcjkwgesnok")
    public suspend fun rules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RuleGroupRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument The rule blocks used to identify the web requests that you want to `allow`, `block`, or `count`. See Rules below for details.
     */
    @JvmName("tprjrlwugupahbgx")
    public suspend fun rules(vararg argument: suspend RuleGroupRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RuleGroupRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument The rule blocks used to identify the web requests that you want to `allow`, `block`, or `count`. See Rules below for details.
     */
    @JvmName("ngqgywvtfunllrlp")
    public suspend fun rules(argument: suspend RuleGroupRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(RuleGroupRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param values The rule blocks used to identify the web requests that you want to `allow`, `block`, or `count`. See Rules below for details.
     */
    @JvmName("ijfhkfkxcjfpvqkt")
    public suspend fun rules(vararg values: RuleGroupRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param value Specifies whether this is for an AWS CloudFront distribution or for a regional application. Valid values are `CLOUDFRONT` or `REGIONAL`. To work with CloudFront, you must also specify the region `us-east-1` (N. Virginia) on the AWS provider.
     */
    @JvmName("rxexskhbcpnwooxc")
    public suspend fun scope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

    /**
     * @param value An array of key:value pairs to associate with the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("mwigtmhpjmsbpclh")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values An array of key:value pairs to associate with the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    @JvmName("iiixrbbkvsswrwck")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Defines and enables Amazon CloudWatch metrics and web request sample collection. See Visibility Configuration below for details.
     */
    @JvmName("nlwqnrpbyxevxcrh")
    public suspend fun visibilityConfig(`value`: RuleGroupVisibilityConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.visibilityConfig = mapped
    }

    /**
     * @param argument Defines and enables Amazon CloudWatch metrics and web request sample collection. See Visibility Configuration below for details.
     */
    @JvmName("kdupvpilfgtpyitk")
    public suspend fun visibilityConfig(argument: suspend RuleGroupVisibilityConfigArgsBuilder.() -> Unit) {
        val toBeMapped = RuleGroupVisibilityConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.visibilityConfig = mapped
    }

    internal fun build(): RuleGroupArgs = RuleGroupArgs(
        capacity = capacity,
        customResponseBodies = customResponseBodies,
        description = description,
        name = name,
        namePrefix = namePrefix,
        rules = rules,
        scope = scope,
        tags = tags,
        visibilityConfig = visibilityConfig,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy