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

com.pulumi.cloudflare.kotlin.BotManagementArgs.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.BotManagementArgs.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.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Provides a resource to configure Bot Management.
 * Specifically, this resource can be used to manage:
 * - **Bot Fight Mode**
 * - **Super Bot Fight Mode**
 * - **Bot Management for Enterprise**
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const example = new cloudflare.BotManagement("example", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     enableJs: true,
 *     sbfmDefinitelyAutomated: "block",
 *     sbfmLikelyAutomated: "managed_challenge",
 *     sbfmVerifiedBots: "allow",
 *     sbfmStaticResourceProtection: false,
 *     optimizeWordpress: true,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example = cloudflare.BotManagement("example",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     enable_js=True,
 *     sbfm_definitely_automated="block",
 *     sbfm_likely_automated="managed_challenge",
 *     sbfm_verified_bots="allow",
 *     sbfm_static_resource_protection=False,
 *     optimize_wordpress=True)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Cloudflare.BotManagement("example", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         EnableJs = true,
 *         SbfmDefinitelyAutomated = "block",
 *         SbfmLikelyAutomated = "managed_challenge",
 *         SbfmVerifiedBots = "allow",
 *         SbfmStaticResourceProtection = false,
 *         OptimizeWordpress = true,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudflare.NewBotManagement(ctx, "example", &cloudflare.BotManagementArgs{
 * 			ZoneId:                       pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			EnableJs:                     pulumi.Bool(true),
 * 			SbfmDefinitelyAutomated:      pulumi.String("block"),
 * 			SbfmLikelyAutomated:          pulumi.String("managed_challenge"),
 * 			SbfmVerifiedBots:             pulumi.String("allow"),
 * 			SbfmStaticResourceProtection: pulumi.Bool(false),
 * 			OptimizeWordpress:            pulumi.Bool(true),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.cloudflare.BotManagement;
 * import com.pulumi.cloudflare.BotManagementArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new BotManagement("example", BotManagementArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .enableJs(true)
 *             .sbfmDefinitelyAutomated("block")
 *             .sbfmLikelyAutomated("managed_challenge")
 *             .sbfmVerifiedBots("allow")
 *             .sbfmStaticResourceProtection(false)
 *             .optimizeWordpress(true)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:BotManagement
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       enableJs: true
 *       sbfmDefinitelyAutomated: block
 *       sbfmLikelyAutomated: managed_challenge
 *       sbfmVerifiedBots: allow
 *       sbfmStaticResourceProtection: false
 *       optimizeWordpress: true
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/botManagement:BotManagement example 
 * ```
 * @property aiBotsProtection Enable rule to block AI Scrapers and Crawlers.
 * @property autoUpdateModel Automatically update to the newest bot detection models created by Cloudflare as they are released. [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes).
 * @property enableJs Use lightweight, invisible JavaScript detections to improve Bot Management. [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
 * @property fightMode Whether to enable Bot Fight Mode.
 * @property optimizeWordpress Whether to optimize Super Bot Fight Mode protections for Wordpress.
 * @property sbfmDefinitelyAutomated Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
 * @property sbfmLikelyAutomated Super Bot Fight Mode (SBFM) action to take on likely automated requests.
 * @property sbfmStaticResourceProtection Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if static resources on your application need bot protection. Note: Static resource protection can also result in legitimate traffic being blocked.
 * @property sbfmVerifiedBots Super Bot Fight Mode (SBFM) action to take on verified bots requests.
 * @property suppressSessionScore Whether to disable tracking the highest bot score for a session in the Bot Management cookie.
 * @property zoneId The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
 */
public data class BotManagementArgs(
    public val aiBotsProtection: Output? = null,
    public val autoUpdateModel: Output? = null,
    public val enableJs: Output? = null,
    public val fightMode: Output? = null,
    public val optimizeWordpress: Output? = null,
    public val sbfmDefinitelyAutomated: Output? = null,
    public val sbfmLikelyAutomated: Output? = null,
    public val sbfmStaticResourceProtection: Output? = null,
    public val sbfmVerifiedBots: Output? = null,
    public val suppressSessionScore: Output? = null,
    public val zoneId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.BotManagementArgs =
        com.pulumi.cloudflare.BotManagementArgs.builder()
            .aiBotsProtection(aiBotsProtection?.applyValue({ args0 -> args0 }))
            .autoUpdateModel(autoUpdateModel?.applyValue({ args0 -> args0 }))
            .enableJs(enableJs?.applyValue({ args0 -> args0 }))
            .fightMode(fightMode?.applyValue({ args0 -> args0 }))
            .optimizeWordpress(optimizeWordpress?.applyValue({ args0 -> args0 }))
            .sbfmDefinitelyAutomated(sbfmDefinitelyAutomated?.applyValue({ args0 -> args0 }))
            .sbfmLikelyAutomated(sbfmLikelyAutomated?.applyValue({ args0 -> args0 }))
            .sbfmStaticResourceProtection(sbfmStaticResourceProtection?.applyValue({ args0 -> args0 }))
            .sbfmVerifiedBots(sbfmVerifiedBots?.applyValue({ args0 -> args0 }))
            .suppressSessionScore(suppressSessionScore?.applyValue({ args0 -> args0 }))
            .zoneId(zoneId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [BotManagementArgs].
 */
@PulumiTagMarker
public class BotManagementArgsBuilder internal constructor() {
    private var aiBotsProtection: Output? = null

    private var autoUpdateModel: Output? = null

    private var enableJs: Output? = null

    private var fightMode: Output? = null

    private var optimizeWordpress: Output? = null

    private var sbfmDefinitelyAutomated: Output? = null

    private var sbfmLikelyAutomated: Output? = null

    private var sbfmStaticResourceProtection: Output? = null

    private var sbfmVerifiedBots: Output? = null

    private var suppressSessionScore: Output? = null

    private var zoneId: Output? = null

    /**
     * @param value Enable rule to block AI Scrapers and Crawlers.
     */
    @JvmName("oaxbvrewbxmkghbe")
    public suspend fun aiBotsProtection(`value`: Output) {
        this.aiBotsProtection = value
    }

    /**
     * @param value Automatically update to the newest bot detection models created by Cloudflare as they are released. [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes).
     */
    @JvmName("gdeoqvgfboxlnwjy")
    public suspend fun autoUpdateModel(`value`: Output) {
        this.autoUpdateModel = value
    }

    /**
     * @param value Use lightweight, invisible JavaScript detections to improve Bot Management. [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
     */
    @JvmName("ebnocvyyrbdltpwn")
    public suspend fun enableJs(`value`: Output) {
        this.enableJs = value
    }

    /**
     * @param value Whether to enable Bot Fight Mode.
     */
    @JvmName("yammndlimupvouux")
    public suspend fun fightMode(`value`: Output) {
        this.fightMode = value
    }

    /**
     * @param value Whether to optimize Super Bot Fight Mode protections for Wordpress.
     */
    @JvmName("bqoxelgnxojngwjk")
    public suspend fun optimizeWordpress(`value`: Output) {
        this.optimizeWordpress = value
    }

    /**
     * @param value Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
     */
    @JvmName("krvnhelyxukqfgwq")
    public suspend fun sbfmDefinitelyAutomated(`value`: Output) {
        this.sbfmDefinitelyAutomated = value
    }

    /**
     * @param value Super Bot Fight Mode (SBFM) action to take on likely automated requests.
     */
    @JvmName("tbeayxjupsoaadxm")
    public suspend fun sbfmLikelyAutomated(`value`: Output) {
        this.sbfmLikelyAutomated = value
    }

    /**
     * @param value Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if static resources on your application need bot protection. Note: Static resource protection can also result in legitimate traffic being blocked.
     */
    @JvmName("wkqqmvskyqgygdyh")
    public suspend fun sbfmStaticResourceProtection(`value`: Output) {
        this.sbfmStaticResourceProtection = value
    }

    /**
     * @param value Super Bot Fight Mode (SBFM) action to take on verified bots requests.
     */
    @JvmName("ebfjeuxbqrhaglnh")
    public suspend fun sbfmVerifiedBots(`value`: Output) {
        this.sbfmVerifiedBots = value
    }

    /**
     * @param value Whether to disable tracking the highest bot score for a session in the Bot Management cookie.
     */
    @JvmName("nelxqmdxikfypqmm")
    public suspend fun suppressSessionScore(`value`: Output) {
        this.suppressSessionScore = value
    }

    /**
     * @param value The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("kvxkwvsujcvexnxs")
    public suspend fun zoneId(`value`: Output) {
        this.zoneId = value
    }

    /**
     * @param value Enable rule to block AI Scrapers and Crawlers.
     */
    @JvmName("afjactdgecjvnnhe")
    public suspend fun aiBotsProtection(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.aiBotsProtection = mapped
    }

    /**
     * @param value Automatically update to the newest bot detection models created by Cloudflare as they are released. [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes).
     */
    @JvmName("idvovhhjxgncapsk")
    public suspend fun autoUpdateModel(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.autoUpdateModel = mapped
    }

    /**
     * @param value Use lightweight, invisible JavaScript detections to improve Bot Management. [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/).
     */
    @JvmName("cdlgcndhvykgwkpt")
    public suspend fun enableJs(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enableJs = mapped
    }

    /**
     * @param value Whether to enable Bot Fight Mode.
     */
    @JvmName("jlfhfdvsyikhisra")
    public suspend fun fightMode(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fightMode = mapped
    }

    /**
     * @param value Whether to optimize Super Bot Fight Mode protections for Wordpress.
     */
    @JvmName("cicqqaucogstdsxu")
    public suspend fun optimizeWordpress(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.optimizeWordpress = mapped
    }

    /**
     * @param value Super Bot Fight Mode (SBFM) action to take on definitely automated requests.
     */
    @JvmName("ugkhdhpsahfgvvrs")
    public suspend fun sbfmDefinitelyAutomated(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sbfmDefinitelyAutomated = mapped
    }

    /**
     * @param value Super Bot Fight Mode (SBFM) action to take on likely automated requests.
     */
    @JvmName("pikxfdntiopantgb")
    public suspend fun sbfmLikelyAutomated(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sbfmLikelyAutomated = mapped
    }

    /**
     * @param value Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if static resources on your application need bot protection. Note: Static resource protection can also result in legitimate traffic being blocked.
     */
    @JvmName("guoydkfxfvsddgih")
    public suspend fun sbfmStaticResourceProtection(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sbfmStaticResourceProtection = mapped
    }

    /**
     * @param value Super Bot Fight Mode (SBFM) action to take on verified bots requests.
     */
    @JvmName("gnslftfigjxgmwdg")
    public suspend fun sbfmVerifiedBots(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sbfmVerifiedBots = mapped
    }

    /**
     * @param value Whether to disable tracking the highest bot score for a session in the Bot Management cookie.
     */
    @JvmName("dboegcuxvxosxtks")
    public suspend fun suppressSessionScore(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.suppressSessionScore = mapped
    }

    /**
     * @param value The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("dershojsjppwjbxt")
    public suspend fun zoneId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zoneId = mapped
    }

    internal fun build(): BotManagementArgs = BotManagementArgs(
        aiBotsProtection = aiBotsProtection,
        autoUpdateModel = autoUpdateModel,
        enableJs = enableJs,
        fightMode = fightMode,
        optimizeWordpress = optimizeWordpress,
        sbfmDefinitelyAutomated = sbfmDefinitelyAutomated,
        sbfmLikelyAutomated = sbfmLikelyAutomated,
        sbfmStaticResourceProtection = sbfmStaticResourceProtection,
        sbfmVerifiedBots = sbfmVerifiedBots,
        suppressSessionScore = suppressSessionScore,
        zoneId = zoneId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy