com.pulumi.cloudflare.kotlin.TeamsRuleArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-cloudflare-kotlin Show documentation
Show all versions of pulumi-cloudflare-kotlin Show documentation
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