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

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

package com.pulumi.awsnative.wafv2.kotlin.inputs

import com.pulumi.awsnative.wafv2.inputs.WebAclByteMatchStatementArgs.builder
import com.pulumi.awsnative.wafv2.kotlin.enums.WebAclPositionalConstraint
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Byte Match statement.
 * @property fieldToMatch The part of the web request that you want AWS WAF to inspect.
 * @property positionalConstraint The area within the portion of the web request that you want AWS WAF to search for `SearchString` . Valid values include the following:
 * *CONTAINS*
 * The specified part of the web request must include the value of `SearchString` , but the location doesn't matter.
 * *CONTAINS_WORD*
 * The specified part of the web request must include the value of `SearchString` , and `SearchString` must contain only alphanumeric characters or underscore (A-Z, a-z, 0-9, or _). In addition, `SearchString` must be a word, which means that both of the following are true:
 * - `SearchString` is at the beginning of the specified part of the web request or is preceded by a character other than an alphanumeric character or underscore (_). Examples include the value of a header and `;BadBot` .
 * - `SearchString` is at the end of the specified part of the web request or is followed by a character other than an alphanumeric character or underscore (_), for example, `BadBot;` and `-BadBot;` .
 * *EXACTLY*
 * The value of the specified part of the web request must exactly match the value of `SearchString` .
 * *STARTS_WITH*
 * The value of `SearchString` must appear at the beginning of the specified part of the web request.
 * *ENDS_WITH*
 * The value of `SearchString` must appear at the end of the specified part of the web request.
 * @property searchString A string value that you want AWS WAF to search for. AWS WAF searches only in the part of web requests that you designate for inspection in `FieldToMatch` . The maximum length of the value is 200 bytes. For alphabetic characters A-Z and a-z, the value is case sensitive.
 * Don't encode this string. Provide the value that you want AWS WAF to search for. AWS CloudFormation automatically base64 encodes the value for you.
 * For example, suppose the value of `Type` is `HEADER` and the value of `Data` is `User-Agent` . If you want to search the `User-Agent` header for the value `BadBot` , you provide the string `BadBot` in the value of `SearchString` .
 * You must specify either `SearchString` or `SearchStringBase64` in a `ByteMatchStatement` .
 * @property searchStringBase64 String to search for in a web request component, base64-encoded. If you don't want to encode the string, specify the unencoded value in `SearchString` instead.
 * You must specify either `SearchString` or `SearchStringBase64` in a `ByteMatchStatement` .
 * @property textTransformations Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by `FieldToMatch` , starting from the lowest priority setting, before inspecting the content for a match.
 */
public data class WebAclByteMatchStatementArgs(
    public val fieldToMatch: Output,
    public val positionalConstraint: Output,
    public val searchString: Output? = null,
    public val searchStringBase64: Output? = null,
    public val textTransformations: Output>,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.wafv2.inputs.WebAclByteMatchStatementArgs =
        com.pulumi.awsnative.wafv2.inputs.WebAclByteMatchStatementArgs.builder()
            .fieldToMatch(fieldToMatch.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .positionalConstraint(
                positionalConstraint.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .searchString(searchString?.applyValue({ args0 -> args0 }))
            .searchStringBase64(searchStringBase64?.applyValue({ args0 -> args0 }))
            .textTransformations(
                textTransformations.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            ).build()
}

/**
 * Builder for [WebAclByteMatchStatementArgs].
 */
@PulumiTagMarker
public class WebAclByteMatchStatementArgsBuilder internal constructor() {
    private var fieldToMatch: Output? = null

    private var positionalConstraint: Output? = null

    private var searchString: Output? = null

    private var searchStringBase64: Output? = null

    private var textTransformations: Output>? = null

    /**
     * @param value The part of the web request that you want AWS WAF to inspect.
     */
    @JvmName("lcymgxepfmobnyha")
    public suspend fun fieldToMatch(`value`: Output) {
        this.fieldToMatch = value
    }

    /**
     * @param value The area within the portion of the web request that you want AWS WAF to search for `SearchString` . Valid values include the following:
     * *CONTAINS*
     * The specified part of the web request must include the value of `SearchString` , but the location doesn't matter.
     * *CONTAINS_WORD*
     * The specified part of the web request must include the value of `SearchString` , and `SearchString` must contain only alphanumeric characters or underscore (A-Z, a-z, 0-9, or _). In addition, `SearchString` must be a word, which means that both of the following are true:
     * - `SearchString` is at the beginning of the specified part of the web request or is preceded by a character other than an alphanumeric character or underscore (_). Examples include the value of a header and `;BadBot` .
     * - `SearchString` is at the end of the specified part of the web request or is followed by a character other than an alphanumeric character or underscore (_), for example, `BadBot;` and `-BadBot;` .
     * *EXACTLY*
     * The value of the specified part of the web request must exactly match the value of `SearchString` .
     * *STARTS_WITH*
     * The value of `SearchString` must appear at the beginning of the specified part of the web request.
     * *ENDS_WITH*
     * The value of `SearchString` must appear at the end of the specified part of the web request.
     */
    @JvmName("vjjqsogakjdoxwtf")
    public suspend fun positionalConstraint(`value`: Output) {
        this.positionalConstraint = value
    }

    /**
     * @param value A string value that you want AWS WAF to search for. AWS WAF searches only in the part of web requests that you designate for inspection in `FieldToMatch` . The maximum length of the value is 200 bytes. For alphabetic characters A-Z and a-z, the value is case sensitive.
     * Don't encode this string. Provide the value that you want AWS WAF to search for. AWS CloudFormation automatically base64 encodes the value for you.
     * For example, suppose the value of `Type` is `HEADER` and the value of `Data` is `User-Agent` . If you want to search the `User-Agent` header for the value `BadBot` , you provide the string `BadBot` in the value of `SearchString` .
     * You must specify either `SearchString` or `SearchStringBase64` in a `ByteMatchStatement` .
     */
    @JvmName("wnhixitsluuahutc")
    public suspend fun searchString(`value`: Output) {
        this.searchString = value
    }

    /**
     * @param value String to search for in a web request component, base64-encoded. If you don't want to encode the string, specify the unencoded value in `SearchString` instead.
     * You must specify either `SearchString` or `SearchStringBase64` in a `ByteMatchStatement` .
     */
    @JvmName("hcfbdahpqaoyyapl")
    public suspend fun searchStringBase64(`value`: Output) {
        this.searchStringBase64 = value
    }

    /**
     * @param value Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by `FieldToMatch` , starting from the lowest priority setting, before inspecting the content for a match.
     */
    @JvmName("mnsjpblxvvyelolc")
    public suspend fun textTransformations(`value`: Output>) {
        this.textTransformations = value
    }

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

    /**
     * @param values Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by `FieldToMatch` , starting from the lowest priority setting, before inspecting the content for a match.
     */
    @JvmName("lopvnyisofpcbhut")
    public suspend fun textTransformations(values: List>) {
        this.textTransformations = Output.all(values)
    }

    /**
     * @param value The part of the web request that you want AWS WAF to inspect.
     */
    @JvmName("kpfehvedhubxfbiw")
    public suspend fun fieldToMatch(`value`: WebAclFieldToMatchArgs) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.fieldToMatch = mapped
    }

    /**
     * @param argument The part of the web request that you want AWS WAF to inspect.
     */
    @JvmName("prldtxgupkgchuqe")
    public suspend fun fieldToMatch(argument: suspend WebAclFieldToMatchArgsBuilder.() -> Unit) {
        val toBeMapped = WebAclFieldToMatchArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.fieldToMatch = mapped
    }

    /**
     * @param value The area within the portion of the web request that you want AWS WAF to search for `SearchString` . Valid values include the following:
     * *CONTAINS*
     * The specified part of the web request must include the value of `SearchString` , but the location doesn't matter.
     * *CONTAINS_WORD*
     * The specified part of the web request must include the value of `SearchString` , and `SearchString` must contain only alphanumeric characters or underscore (A-Z, a-z, 0-9, or _). In addition, `SearchString` must be a word, which means that both of the following are true:
     * - `SearchString` is at the beginning of the specified part of the web request or is preceded by a character other than an alphanumeric character or underscore (_). Examples include the value of a header and `;BadBot` .
     * - `SearchString` is at the end of the specified part of the web request or is followed by a character other than an alphanumeric character or underscore (_), for example, `BadBot;` and `-BadBot;` .
     * *EXACTLY*
     * The value of the specified part of the web request must exactly match the value of `SearchString` .
     * *STARTS_WITH*
     * The value of `SearchString` must appear at the beginning of the specified part of the web request.
     * *ENDS_WITH*
     * The value of `SearchString` must appear at the end of the specified part of the web request.
     */
    @JvmName("jcponcvyhmpcybee")
    public suspend fun positionalConstraint(`value`: WebAclPositionalConstraint) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.positionalConstraint = mapped
    }

    /**
     * @param value A string value that you want AWS WAF to search for. AWS WAF searches only in the part of web requests that you designate for inspection in `FieldToMatch` . The maximum length of the value is 200 bytes. For alphabetic characters A-Z and a-z, the value is case sensitive.
     * Don't encode this string. Provide the value that you want AWS WAF to search for. AWS CloudFormation automatically base64 encodes the value for you.
     * For example, suppose the value of `Type` is `HEADER` and the value of `Data` is `User-Agent` . If you want to search the `User-Agent` header for the value `BadBot` , you provide the string `BadBot` in the value of `SearchString` .
     * You must specify either `SearchString` or `SearchStringBase64` in a `ByteMatchStatement` .
     */
    @JvmName("gmwoqqugptgpwhnc")
    public suspend fun searchString(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.searchString = mapped
    }

    /**
     * @param value String to search for in a web request component, base64-encoded. If you don't want to encode the string, specify the unencoded value in `SearchString` instead.
     * You must specify either `SearchString` or `SearchStringBase64` in a `ByteMatchStatement` .
     */
    @JvmName("scrplwiooecfabji")
    public suspend fun searchStringBase64(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.searchStringBase64 = mapped
    }

    /**
     * @param value Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by `FieldToMatch` , starting from the lowest priority setting, before inspecting the content for a match.
     */
    @JvmName("waxqaadqesvxdywq")
    public suspend fun textTransformations(`value`: List) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.textTransformations = mapped
    }

    /**
     * @param argument Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by `FieldToMatch` , starting from the lowest priority setting, before inspecting the content for a match.
     */
    @JvmName("nokfjqeqonelqtwm")
    public suspend fun textTransformations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            WebAclTextTransformationArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.textTransformations = mapped
    }

    /**
     * @param argument Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by `FieldToMatch` , starting from the lowest priority setting, before inspecting the content for a match.
     */
    @JvmName("cronmwuxhejqxlqm")
    public suspend fun textTransformations(vararg argument: suspend WebAclTextTransformationArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            WebAclTextTransformationArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.textTransformations = mapped
    }

    /**
     * @param argument Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by `FieldToMatch` , starting from the lowest priority setting, before inspecting the content for a match.
     */
    @JvmName("aqpnlepxxpytbmjd")
    public suspend fun textTransformations(argument: suspend WebAclTextTransformationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            WebAclTextTransformationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.textTransformations = mapped
    }

    /**
     * @param values Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection. If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by `FieldToMatch` , starting from the lowest priority setting, before inspecting the content for a match.
     */
    @JvmName("awnbmrraqkjrivam")
    public suspend fun textTransformations(vararg values: WebAclTextTransformationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.textTransformations = mapped
    }

    internal fun build(): WebAclByteMatchStatementArgs = WebAclByteMatchStatementArgs(
        fieldToMatch = fieldToMatch ?: throw PulumiNullFieldException("fieldToMatch"),
        positionalConstraint = positionalConstraint ?: throw
            PulumiNullFieldException("positionalConstraint"),
        searchString = searchString,
        searchStringBase64 = searchStringBase64,
        textTransformations = textTransformations ?: throw PulumiNullFieldException("textTransformations"),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy