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

com.pulumi.cloudflare.kotlin.StaticRouteArgs.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.StaticRouteArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a resource, that manages Cloudflare static routes for Magic
 * Transit or Magic WAN. Static routes are used to route traffic
 * through GRE tunnels.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const example = new cloudflare.StaticRoute("example", {
 *     accountId: "f037e56e89293a057740de681ac9abbe",
 *     description: "New route for new prefix 192.0.2.0/24",
 *     prefix: "192.0.2.0/24",
 *     nexthop: "10.0.0.0",
 *     priority: 100,
 *     weight: 10,
 *     coloNames: ["den01"],
 *     coloRegions: ["APAC"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example = cloudflare.StaticRoute("example",
 *     account_id="f037e56e89293a057740de681ac9abbe",
 *     description="New route for new prefix 192.0.2.0/24",
 *     prefix="192.0.2.0/24",
 *     nexthop="10.0.0.0",
 *     priority=100,
 *     weight=10,
 *     colo_names=["den01"],
 *     colo_regions=["APAC"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Cloudflare.StaticRoute("example", new()
 *     {
 *         AccountId = "f037e56e89293a057740de681ac9abbe",
 *         Description = "New route for new prefix 192.0.2.0/24",
 *         Prefix = "192.0.2.0/24",
 *         Nexthop = "10.0.0.0",
 *         Priority = 100,
 *         Weight = 10,
 *         ColoNames = new[]
 *         {
 *             "den01",
 *         },
 *         ColoRegions = new[]
 *         {
 *             "APAC",
 *         },
 *     });
 * });
 * ```
 * ```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.NewStaticRoute(ctx, "example", &cloudflare.StaticRouteArgs{
 * 			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
 * 			Description: pulumi.String("New route for new prefix 192.0.2.0/24"),
 * 			Prefix:      pulumi.String("192.0.2.0/24"),
 * 			Nexthop:     pulumi.String("10.0.0.0"),
 * 			Priority:    pulumi.Int(100),
 * 			Weight:      pulumi.Int(10),
 * 			ColoNames: pulumi.StringArray{
 * 				pulumi.String("den01"),
 * 			},
 * 			ColoRegions: pulumi.StringArray{
 * 				pulumi.String("APAC"),
 * 			},
 * 		})
 * 		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.StaticRoute;
 * import com.pulumi.cloudflare.StaticRouteArgs;
 * 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 StaticRoute("example", StaticRouteArgs.builder()
 *             .accountId("f037e56e89293a057740de681ac9abbe")
 *             .description("New route for new prefix 192.0.2.0/24")
 *             .prefix("192.0.2.0/24")
 *             .nexthop("10.0.0.0")
 *             .priority(100)
 *             .weight(10)
 *             .coloNames("den01")
 *             .coloRegions("APAC")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:StaticRoute
 *     properties:
 *       accountId: f037e56e89293a057740de681ac9abbe
 *       description: New route for new prefix 192.0.2.0/24
 *       prefix: 192.0.2.0/24
 *       nexthop: 10.0.0.0
 *       priority: 100
 *       weight: 10
 *       coloNames:
 *         - den01
 *       coloRegions:
 *         - APAC
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/staticRoute:StaticRoute example /
 * ```
 * @property accountId The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
 * @property coloNames List of Cloudflare colocation regions for this static route.
 * @property coloRegions List of Cloudflare colocation names for this static route.
 * @property description Description of the static route.
 * @property nexthop The nexthop IP address where traffic will be routed to.
 * @property prefix Your network prefix using CIDR notation.
 * @property priority The priority for the static route.
 * @property weight The optional weight for ECMP routes. **Modifying this attribute will force creation of a new resource.**
 */
public data class StaticRouteArgs(
    public val accountId: Output? = null,
    public val coloNames: Output>? = null,
    public val coloRegions: Output>? = null,
    public val description: Output? = null,
    public val nexthop: Output? = null,
    public val prefix: Output? = null,
    public val priority: Output? = null,
    public val weight: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.StaticRouteArgs =
        com.pulumi.cloudflare.StaticRouteArgs.builder()
            .accountId(accountId?.applyValue({ args0 -> args0 }))
            .coloNames(coloNames?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .coloRegions(coloRegions?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .description(description?.applyValue({ args0 -> args0 }))
            .nexthop(nexthop?.applyValue({ args0 -> args0 }))
            .prefix(prefix?.applyValue({ args0 -> args0 }))
            .priority(priority?.applyValue({ args0 -> args0 }))
            .weight(weight?.applyValue({ args0 -> args0 })).build()
}

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

    private var coloNames: Output>? = null

    private var coloRegions: Output>? = null

    private var description: Output? = null

    private var nexthop: Output? = null

    private var prefix: Output? = null

    private var priority: Output? = null

    private var weight: Output? = null

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

    /**
     * @param value List of Cloudflare colocation regions for this static route.
     */
    @JvmName("tctjukkjiuagmhvv")
    public suspend fun coloNames(`value`: Output>) {
        this.coloNames = value
    }

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

    /**
     * @param values List of Cloudflare colocation regions for this static route.
     */
    @JvmName("tudbgmlvrcrnrgjb")
    public suspend fun coloNames(values: List>) {
        this.coloNames = Output.all(values)
    }

    /**
     * @param value List of Cloudflare colocation names for this static route.
     */
    @JvmName("oecpqlmqpqfqyarn")
    public suspend fun coloRegions(`value`: Output>) {
        this.coloRegions = value
    }

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

    /**
     * @param values List of Cloudflare colocation names for this static route.
     */
    @JvmName("qfyxksdqvawpjysn")
    public suspend fun coloRegions(values: List>) {
        this.coloRegions = Output.all(values)
    }

    /**
     * @param value Description of the static route.
     */
    @JvmName("nnfghkdmuoxhsppu")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The nexthop IP address where traffic will be routed to.
     */
    @JvmName("acinqdyroitfxwmu")
    public suspend fun nexthop(`value`: Output) {
        this.nexthop = value
    }

    /**
     * @param value Your network prefix using CIDR notation.
     */
    @JvmName("riynyrqokrqhodld")
    public suspend fun prefix(`value`: Output) {
        this.prefix = value
    }

    /**
     * @param value The priority for the static route.
     */
    @JvmName("xepbjumoyuvmqris")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

    /**
     * @param value The optional weight for ECMP routes. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("onymcancfgabujmh")
    public suspend fun weight(`value`: Output) {
        this.weight = value
    }

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

    /**
     * @param value List of Cloudflare colocation regions for this static route.
     */
    @JvmName("gokwxihfujqesntm")
    public suspend fun coloNames(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.coloNames = mapped
    }

    /**
     * @param values List of Cloudflare colocation regions for this static route.
     */
    @JvmName("vncotdixpdjkjljd")
    public suspend fun coloNames(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.coloNames = mapped
    }

    /**
     * @param value List of Cloudflare colocation names for this static route.
     */
    @JvmName("vwrgjmhmweklskyp")
    public suspend fun coloRegions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.coloRegions = mapped
    }

    /**
     * @param values List of Cloudflare colocation names for this static route.
     */
    @JvmName("noslxojltwasdjry")
    public suspend fun coloRegions(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.coloRegions = mapped
    }

    /**
     * @param value Description of the static route.
     */
    @JvmName("lqjnniksjansckfl")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The nexthop IP address where traffic will be routed to.
     */
    @JvmName("cqubhteobjwmmatl")
    public suspend fun nexthop(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nexthop = mapped
    }

    /**
     * @param value Your network prefix using CIDR notation.
     */
    @JvmName("wlgffehweqijnvns")
    public suspend fun prefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.prefix = mapped
    }

    /**
     * @param value The priority for the static route.
     */
    @JvmName("qdlpnlprdlyrpslc")
    public suspend fun priority(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.priority = mapped
    }

    /**
     * @param value The optional weight for ECMP routes. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("ldqckjuugybuhope")
    public suspend fun weight(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.weight = mapped
    }

    internal fun build(): StaticRouteArgs = StaticRouteArgs(
        accountId = accountId,
        coloNames = coloNames,
        coloRegions = coloRegions,
        description = description,
        nexthop = nexthop,
        prefix = prefix,
        priority = priority,
        weight = weight,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy