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

com.pulumi.cloudflare.kotlin.TeamsRuleArgs.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.TeamsRuleArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.TeamsRuleRuleSettingsArgs
import com.pulumi.cloudflare.kotlin.inputs.TeamsRuleRuleSettingsArgsBuilder
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.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a Cloudflare Teams rule resource. Teams rules comprise secure web gateway policies.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const example = new cloudflare.TeamsRule("example", {
 *     accountId: "f037e56e89293a057740de681ac9abbe",
 *     name: "office",
 *     description: "desc",
 *     precedence: 1,
 *     action: "block",
 *     filters: ["http"],
 *     traffic: "http.request.uri == \"https://www.example.com/malicious\"",
 *     ruleSettings: {
 *         blockPageEnabled: true,
 *         blockPageReason: "access not permitted",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example = cloudflare.TeamsRule("example",
 *     account_id="f037e56e89293a057740de681ac9abbe",
 *     name="office",
 *     description="desc",
 *     precedence=1,
 *     action="block",
 *     filters=["http"],
 *     traffic="http.request.uri == \"https://www.example.com/malicious\"",
 *     rule_settings={
 *         "block_page_enabled": True,
 *         "block_page_reason": "access not permitted",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Cloudflare.TeamsRule("example", new()
 *     {
 *         AccountId = "f037e56e89293a057740de681ac9abbe",
 *         Name = "office",
 *         Description = "desc",
 *         Precedence = 1,
 *         Action = "block",
 *         Filters = new[]
 *         {
 *             "http",
 *         },
 *         Traffic = "http.request.uri == \"https://www.example.com/malicious\"",
 *         RuleSettings = new Cloudflare.Inputs.TeamsRuleRuleSettingsArgs
 *         {
 *             BlockPageEnabled = true,
 *             BlockPageReason = "access not permitted",
 *         },
 *     });
 * });
 * ```
 * ```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.NewTeamsRule(ctx, "example", &cloudflare.TeamsRuleArgs{
 * 			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
 * 			Name:        pulumi.String("office"),
 * 			Description: pulumi.String("desc"),
 * 			Precedence:  pulumi.Int(1),
 * 			Action:      pulumi.String("block"),
 * 			Filters: pulumi.StringArray{
 * 				pulumi.String("http"),
 * 			},
 * 			Traffic: pulumi.String("http.request.uri == \"https://www.example.com/malicious\""),
 * 			RuleSettings: &cloudflare.TeamsRuleRuleSettingsArgs{
 * 				BlockPageEnabled: pulumi.Bool(true),
 * 				BlockPageReason:  pulumi.String("access not permitted"),
 * 			},
 * 		})
 * 		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.TeamsRule;
 * import com.pulumi.cloudflare.TeamsRuleArgs;
 * import com.pulumi.cloudflare.inputs.TeamsRuleRuleSettingsArgs;
 * 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 TeamsRule("example", TeamsRuleArgs.builder()
 *             .accountId("f037e56e89293a057740de681ac9abbe")
 *             .name("office")
 *             .description("desc")
 *             .precedence(1)
 *             .action("block")
 *             .filters("http")
 *             .traffic("http.request.uri == \"https://www.example.com/malicious\"")
 *             .ruleSettings(TeamsRuleRuleSettingsArgs.builder()
 *                 .blockPageEnabled(true)
 *                 .blockPageReason("access not permitted")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:TeamsRule
 *     properties:
 *       accountId: f037e56e89293a057740de681ac9abbe
 *       name: office
 *       description: desc
 *       precedence: 1
 *       action: block
 *       filters:
 *         - http
 *       traffic: http.request.uri == "https://www.example.com/malicious"
 *       ruleSettings:
 *         blockPageEnabled: true
 *         blockPageReason: access not permitted
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/teamsRule:TeamsRule example /
 * ```
 * @property accountId The account identifier to target for the resource.
 * @property action The action executed by matched teams rule. Available values: `allow`, `block`, `safesearch`, `ytrestricted`, `on`, `off`, `scan`, `noscan`, `isolate`, `noisolate`, `override`, `l4_override`, `egress`, `audit_ssh`, `resolve`.
 * @property description The description of the teams rule.
 * @property devicePosture The wirefilter expression to be used for device_posture check matching.
 * @property enabled Indicator of rule enablement.
 * @property filters The protocol or layer to evaluate the traffic and identity expressions.
 * @property identity The wirefilter expression to be used for identity matching.
 * @property name The name of the teams rule.
 * @property precedence The evaluation precedence of the teams rule.
 * @property ruleSettings Additional rule settings.
 * @property traffic The wirefilter expression to be used for traffic matching.
 */
public data class TeamsRuleArgs(
    public val accountId: Output? = null,
    public val action: Output? = null,
    public val description: Output? = null,
    public val devicePosture: Output? = null,
    public val enabled: Output? = null,
    public val filters: Output>? = null,
    public val identity: Output? = null,
    public val name: Output? = null,
    public val precedence: Output? = null,
    public val ruleSettings: Output? = null,
    public val traffic: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.TeamsRuleArgs =
        com.pulumi.cloudflare.TeamsRuleArgs.builder()
            .accountId(accountId?.applyValue({ args0 -> args0 }))
            .action(action?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .devicePosture(devicePosture?.applyValue({ args0 -> args0 }))
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .filters(filters?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .identity(identity?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .precedence(precedence?.applyValue({ args0 -> args0 }))
            .ruleSettings(ruleSettings?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .traffic(traffic?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [TeamsRuleArgs].
 */
@PulumiTagMarker
public class TeamsRuleArgsBuilder internal constructor() {
    private var accountId: Output? = null

    private var action: Output? = null

    private var description: Output? = null

    private var devicePosture: Output? = null

    private var enabled: Output? = null

    private var filters: Output>? = null

    private var identity: Output? = null

    private var name: Output? = null

    private var precedence: Output? = null

    private var ruleSettings: Output? = null

    private var traffic: Output? = null

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("hefswkxxdlwqqnaq")
    public suspend fun accountId(`value`: Output) {
        this.accountId = value
    }

    /**
     * @param value The action executed by matched teams rule. Available values: `allow`, `block`, `safesearch`, `ytrestricted`, `on`, `off`, `scan`, `noscan`, `isolate`, `noisolate`, `override`, `l4_override`, `egress`, `audit_ssh`, `resolve`.
     */
    @JvmName("vjjvllwvlwhmdfjn")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

    /**
     * @param value The description of the teams rule.
     */
    @JvmName("hwhbeknirmbbfbpf")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The wirefilter expression to be used for device_posture check matching.
     */
    @JvmName("cxburtrqivkregoq")
    public suspend fun devicePosture(`value`: Output) {
        this.devicePosture = value
    }

    /**
     * @param value Indicator of rule enablement.
     */
    @JvmName("uqpomopsurxjyqry")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value The protocol or layer to evaluate the traffic and identity expressions.
     */
    @JvmName("khlebtphbfmsgwac")
    public suspend fun filters(`value`: Output>) {
        this.filters = value
    }

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

    /**
     * @param values The protocol or layer to evaluate the traffic and identity expressions.
     */
    @JvmName("idqkdviuhejkxxin")
    public suspend fun filters(values: List>) {
        this.filters = Output.all(values)
    }

    /**
     * @param value The wirefilter expression to be used for identity matching.
     */
    @JvmName("jyjtjigegnihrwwl")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value The name of the teams rule.
     */
    @JvmName("vimalvhowtudruqv")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The evaluation precedence of the teams rule.
     */
    @JvmName("iijxifieuuhsetea")
    public suspend fun precedence(`value`: Output) {
        this.precedence = value
    }

    /**
     * @param value Additional rule settings.
     */
    @JvmName("ddftucoihanphdnh")
    public suspend fun ruleSettings(`value`: Output) {
        this.ruleSettings = value
    }

    /**
     * @param value The wirefilter expression to be used for traffic matching.
     */
    @JvmName("tosdmwyknpbgnxhn")
    public suspend fun traffic(`value`: Output) {
        this.traffic = value
    }

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("ivfwfnbhcdhitpbn")
    public suspend fun accountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accountId = mapped
    }

    /**
     * @param value The action executed by matched teams rule. Available values: `allow`, `block`, `safesearch`, `ytrestricted`, `on`, `off`, `scan`, `noscan`, `isolate`, `noisolate`, `override`, `l4_override`, `egress`, `audit_ssh`, `resolve`.
     */
    @JvmName("xdgnaksnhiippbwx")
    public suspend fun action(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.action = mapped
    }

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

    /**
     * @param value The wirefilter expression to be used for device_posture check matching.
     */
    @JvmName("frutgoykrnubdpmi")
    public suspend fun devicePosture(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.devicePosture = mapped
    }

    /**
     * @param value Indicator of rule enablement.
     */
    @JvmName("oltnjihylfdlaxas")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value The protocol or layer to evaluate the traffic and identity expressions.
     */
    @JvmName("gbolijvppjghxpnh")
    public suspend fun filters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filters = mapped
    }

    /**
     * @param values The protocol or layer to evaluate the traffic and identity expressions.
     */
    @JvmName("irvtymkssbdxgxch")
    public suspend fun filters(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.filters = mapped
    }

    /**
     * @param value The wirefilter expression to be used for identity matching.
     */
    @JvmName("njrunjldxixrmdgh")
    public suspend fun identity(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

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

    /**
     * @param value The evaluation precedence of the teams rule.
     */
    @JvmName("nbbebhobxknmypqu")
    public suspend fun precedence(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.precedence = mapped
    }

    /**
     * @param value Additional rule settings.
     */
    @JvmName("xrwomgndfdbrplth")
    public suspend fun ruleSettings(`value`: TeamsRuleRuleSettingsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleSettings = mapped
    }

    /**
     * @param argument Additional rule settings.
     */
    @JvmName("xrfnemustmphycoa")
    public suspend fun ruleSettings(argument: suspend TeamsRuleRuleSettingsArgsBuilder.() -> Unit) {
        val toBeMapped = TeamsRuleRuleSettingsArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.ruleSettings = mapped
    }

    /**
     * @param value The wirefilter expression to be used for traffic matching.
     */
    @JvmName("aqvdqbkkhsmiqihp")
    public suspend fun traffic(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.traffic = mapped
    }

    internal fun build(): TeamsRuleArgs = TeamsRuleArgs(
        accountId = accountId,
        action = action,
        description = description,
        devicePosture = devicePosture,
        enabled = enabled,
        filters = filters,
        identity = identity,
        name = name,
        precedence = precedence,
        ruleSettings = ruleSettings,
        traffic = traffic,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy