com.pulumi.cloudflare.kotlin.EmailRoutingRuleArgs.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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
import com.pulumi.cloudflare.EmailRoutingRuleArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.EmailRoutingRuleActionArgs
import com.pulumi.cloudflare.kotlin.inputs.EmailRoutingRuleActionArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.EmailRoutingRuleMatcherArgs
import com.pulumi.cloudflare.kotlin.inputs.EmailRoutingRuleMatcherArgsBuilder
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
/**
* The [Email Routing Rule](https://developers.cloudflare.com/email-routing/setup/email-routing-addresses/#email-rule-actions) resource allows you to create and manage email routing rules for a zone.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* const main = new cloudflare.EmailRoutingRule("main", {
* zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
* name: "terraform rule",
* enabled: true,
* matchers: [{
* type: "literal",
* field: "to",
* value: "[email protected]",
* }],
* actions: [{
* type: "forward",
* values: ["destinationaddress@example.net"],
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* main = cloudflare.EmailRoutingRule("main",
* zone_id="0da42c8d2132a9ddaf714f9e7c920711",
* name="terraform rule",
* enabled=True,
* matchers=[{
* "type": "literal",
* "field": "to",
* "value": "[email protected]",
* }],
* actions=[{
* "type": "forward",
* "values": ["destinationaddress@example.net"],
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* var main = new Cloudflare.EmailRoutingRule("main", new()
* {
* ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
* Name = "terraform rule",
* Enabled = true,
* Matchers = new[]
* {
* new Cloudflare.Inputs.EmailRoutingRuleMatcherArgs
* {
* Type = "literal",
* Field = "to",
* Value = "[email protected]",
* },
* },
* Actions = new[]
* {
* new Cloudflare.Inputs.EmailRoutingRuleActionArgs
* {
* Type = "forward",
* Values = new[]
* {
* "[email protected]",
* },
* },
* },
* });
* });
* ```
* ```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.NewEmailRoutingRule(ctx, "main", &cloudflare.EmailRoutingRuleArgs{
* ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
* Name: pulumi.String("terraform rule"),
* Enabled: pulumi.Bool(true),
* Matchers: cloudflare.EmailRoutingRuleMatcherArray{
* &cloudflare.EmailRoutingRuleMatcherArgs{
* Type: pulumi.String("literal"),
* Field: pulumi.String("to"),
* Value: pulumi.String("[email protected]"),
* },
* },
* Actions: cloudflare.EmailRoutingRuleActionArray{
* &cloudflare.EmailRoutingRuleActionArgs{
* Type: pulumi.String("forward"),
* Values: pulumi.StringArray{
* pulumi.String("[email protected]"),
* },
* },
* },
* })
* 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.EmailRoutingRule;
* import com.pulumi.cloudflare.EmailRoutingRuleArgs;
* import com.pulumi.cloudflare.inputs.EmailRoutingRuleMatcherArgs;
* import com.pulumi.cloudflare.inputs.EmailRoutingRuleActionArgs;
* 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 main = new EmailRoutingRule("main", EmailRoutingRuleArgs.builder()
* .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
* .name("terraform rule")
* .enabled(true)
* .matchers(EmailRoutingRuleMatcherArgs.builder()
* .type("literal")
* .field("to")
* .value("[email protected]")
* .build())
* .actions(EmailRoutingRuleActionArgs.builder()
* .type("forward")
* .values("[email protected]")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* main:
* type: cloudflare:EmailRoutingRule
* properties:
* zoneId: 0da42c8d2132a9ddaf714f9e7c920711
* name: terraform rule
* enabled: true
* matchers:
* - type: literal
* field: to
* value: [email protected]
* actions:
* - type: forward
* values:
* - [email protected]
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/emailRoutingRule:EmailRoutingRule example /
* ```
* @property actions Actions to take when a match is found.
* @property enabled Whether the email routing rule is enabled.
* @property matchers Matching patterns to forward to your actions.
* @property name Routing rule name.
* @property priority The priority of the email routing rule.
* @property zoneId The zone identifier to target for the resource.
*/
public data class EmailRoutingRuleArgs(
public val actions: Output>? = null,
public val enabled: Output? = null,
public val matchers: Output>? = null,
public val name: Output? = null,
public val priority: Output? = null,
public val zoneId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.EmailRoutingRuleArgs =
com.pulumi.cloudflare.EmailRoutingRuleArgs.builder()
.actions(
actions?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.enabled(enabled?.applyValue({ args0 -> args0 }))
.matchers(
matchers?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.name(name?.applyValue({ args0 -> args0 }))
.priority(priority?.applyValue({ args0 -> args0 }))
.zoneId(zoneId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [EmailRoutingRuleArgs].
*/
@PulumiTagMarker
public class EmailRoutingRuleArgsBuilder internal constructor() {
private var actions: Output>? = null
private var enabled: Output? = null
private var matchers: Output>? = null
private var name: Output? = null
private var priority: Output? = null
private var zoneId: Output? = null
/**
* @param value Actions to take when a match is found.
*/
@JvmName("vcxqwmihshfltvto")
public suspend fun actions(`value`: Output>) {
this.actions = value
}
@JvmName("nywdynddvpvhfaru")
public suspend fun actions(vararg values: Output) {
this.actions = Output.all(values.asList())
}
/**
* @param values Actions to take when a match is found.
*/
@JvmName("iugxmpyhepihrcws")
public suspend fun actions(values: List