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

com.pulumi.cloudflare.kotlin.ZeroTrustGatewayPolicyArgs.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.ZeroTrustGatewayPolicyArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustGatewayPolicyRuleSettingsArgs
import com.pulumi.cloudflare.kotlin.inputs.ZeroTrustGatewayPolicyRuleSettingsArgsBuilder
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.ZeroTrustGatewayPolicy("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.ZeroTrustGatewayPolicy("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.ZeroTrustGatewayPolicy("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.ZeroTrustGatewayPolicyRuleSettingsArgs
 *         {
 *             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.NewZeroTrustGatewayPolicy(ctx, "example", &cloudflare.ZeroTrustGatewayPolicyArgs{
 * 			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.ZeroTrustGatewayPolicyRuleSettingsArgs{
 * 				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.ZeroTrustGatewayPolicy;
 * import com.pulumi.cloudflare.ZeroTrustGatewayPolicyArgs;
 * import com.pulumi.cloudflare.inputs.ZeroTrustGatewayPolicyRuleSettingsArgs;
 * 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 ZeroTrustGatewayPolicy("example", ZeroTrustGatewayPolicyArgs.builder()
 *             .accountId("f037e56e89293a057740de681ac9abbe")
 *             .name("office")
 *             .description("desc")
 *             .precedence(1)
 *             .action("block")
 *             .filters("http")
 *             .traffic("http.request.uri == \"https://www.example.com/malicious\"")
 *             .ruleSettings(ZeroTrustGatewayPolicyRuleSettingsArgs.builder()
 *                 .blockPageEnabled(true)
 *                 .blockPageReason("access not permitted")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:ZeroTrustGatewayPolicy
 *     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/zeroTrustGatewayPolicy:ZeroTrustGatewayPolicy 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 ZeroTrustGatewayPolicyArgs(
    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.ZeroTrustGatewayPolicyArgs =
        com.pulumi.cloudflare.ZeroTrustGatewayPolicyArgs.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 [ZeroTrustGatewayPolicyArgs].
 */
@PulumiTagMarker
public class ZeroTrustGatewayPolicyArgsBuilder 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("sjqirmyrfhcelfyj")
    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("xepaslntnqrplqup")
    public suspend fun action(`value`: Output) {
        this.action = value
    }

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

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

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

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

    @JvmName("uhcvfqhpuchqggut")
    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("bvtcelmrvqplbggi")
    public suspend fun filters(values: List>) {
        this.filters = Output.all(values)
    }

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

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

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

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

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

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("tdbufcueanourjre")
    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("bvexnbekrmacdflg")
    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("qumjxaaunusqjbru")
    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("cqcdlfkgikqwvcta")
    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("xdwvteoekktriehm")
    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("bxmwvvihgjkhrgnt")
    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("afiwbypmkxxipago")
    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("lhbswybjvqebhjad")
    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("rlakwrhkqcglruci")
    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("sjqpixbfuknxewrg")
    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("qblqpakmbphcitvu")
    public suspend fun ruleSettings(`value`: ZeroTrustGatewayPolicyRuleSettingsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ruleSettings = mapped
    }

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

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

    internal fun build(): ZeroTrustGatewayPolicyArgs = ZeroTrustGatewayPolicyArgs(
        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