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

com.pulumi.cloudflare.kotlin.GreTunnel.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.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

/**
 * Builder for [GreTunnel].
 */
@PulumiTagMarker
public class GreTunnelResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: GreTunnelArgs = GreTunnelArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend GreTunnelArgsBuilder.() -> Unit) {
        val builder = GreTunnelArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): GreTunnel {
        val builtJavaResource = com.pulumi.cloudflare.GreTunnel(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return GreTunnel(builtJavaResource)
    }
}

/**
 * Provides a resource, that manages GRE tunnels for Magic Transit.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const example = new cloudflare.GreTunnel("example", {
 *     accountId: "f037e56e89293a057740de681ac9abbe",
 *     name: "GRE_1",
 *     customerGreEndpoint: "203.0.113.1",
 *     cloudflareGreEndpoint: "203.0.113.2",
 *     interfaceAddress: "192.0.2.0/31",
 *     description: "Tunnel for ISP X",
 *     ttl: 64,
 *     mtu: 1476,
 *     healthCheckEnabled: true,
 *     healthCheckTarget: "203.0.113.1",
 *     healthCheckType: "reply",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example = cloudflare.GreTunnel("example",
 *     account_id="f037e56e89293a057740de681ac9abbe",
 *     name="GRE_1",
 *     customer_gre_endpoint="203.0.113.1",
 *     cloudflare_gre_endpoint="203.0.113.2",
 *     interface_address="192.0.2.0/31",
 *     description="Tunnel for ISP X",
 *     ttl=64,
 *     mtu=1476,
 *     health_check_enabled=True,
 *     health_check_target="203.0.113.1",
 *     health_check_type="reply")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Cloudflare.GreTunnel("example", new()
 *     {
 *         AccountId = "f037e56e89293a057740de681ac9abbe",
 *         Name = "GRE_1",
 *         CustomerGreEndpoint = "203.0.113.1",
 *         CloudflareGreEndpoint = "203.0.113.2",
 *         InterfaceAddress = "192.0.2.0/31",
 *         Description = "Tunnel for ISP X",
 *         Ttl = 64,
 *         Mtu = 1476,
 *         HealthCheckEnabled = true,
 *         HealthCheckTarget = "203.0.113.1",
 *         HealthCheckType = "reply",
 *     });
 * });
 * ```
 * ```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.NewGreTunnel(ctx, "example", &cloudflare.GreTunnelArgs{
 * 			AccountId:             pulumi.String("f037e56e89293a057740de681ac9abbe"),
 * 			Name:                  pulumi.String("GRE_1"),
 * 			CustomerGreEndpoint:   pulumi.String("203.0.113.1"),
 * 			CloudflareGreEndpoint: pulumi.String("203.0.113.2"),
 * 			InterfaceAddress:      pulumi.String("192.0.2.0/31"),
 * 			Description:           pulumi.String("Tunnel for ISP X"),
 * 			Ttl:                   pulumi.Int(64),
 * 			Mtu:                   pulumi.Int(1476),
 * 			HealthCheckEnabled:    pulumi.Bool(true),
 * 			HealthCheckTarget:     pulumi.String("203.0.113.1"),
 * 			HealthCheckType:       pulumi.String("reply"),
 * 		})
 * 		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.GreTunnel;
 * import com.pulumi.cloudflare.GreTunnelArgs;
 * 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 GreTunnel("example", GreTunnelArgs.builder()
 *             .accountId("f037e56e89293a057740de681ac9abbe")
 *             .name("GRE_1")
 *             .customerGreEndpoint("203.0.113.1")
 *             .cloudflareGreEndpoint("203.0.113.2")
 *             .interfaceAddress("192.0.2.0/31")
 *             .description("Tunnel for ISP X")
 *             .ttl(64)
 *             .mtu(1476)
 *             .healthCheckEnabled(true)
 *             .healthCheckTarget("203.0.113.1")
 *             .healthCheckType("reply")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:GreTunnel
 *     properties:
 *       accountId: f037e56e89293a057740de681ac9abbe
 *       name: GRE_1
 *       customerGreEndpoint: 203.0.113.1
 *       cloudflareGreEndpoint: 203.0.113.2
 *       interfaceAddress: 192.0.2.0/31
 *       description: Tunnel for ISP X
 *       ttl: 64
 *       mtu: 1476
 *       healthCheckEnabled: true
 *       healthCheckTarget: 203.0.113.1
 *       healthCheckType: reply
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/greTunnel:GreTunnel example /
 * ```
 */
public class GreTunnel internal constructor(
    override val javaResource: com.pulumi.cloudflare.GreTunnel,
) : KotlinCustomResource(javaResource, GreTunnelMapper) {
    /**
     * The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    public val accountId: Output?
        get() = javaResource.accountId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The IP address assigned to the Cloudflare side of the GRE tunnel.
     */
    public val cloudflareGreEndpoint: Output
        get() = javaResource.cloudflareGreEndpoint().applyValue({ args0 -> args0 })

    /**
     * The IP address assigned to the customer side of the GRE tunnel.
     */
    public val customerGreEndpoint: Output
        get() = javaResource.customerGreEndpoint().applyValue({ args0 -> args0 })

    /**
     * Description of the GRE tunnel intent.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Specifies if ICMP tunnel health checks are enabled.
     */
    public val healthCheckEnabled: Output
        get() = javaResource.healthCheckEnabled().applyValue({ args0 -> args0 })

    /**
     * The IP address of the customer endpoint that will receive tunnel health checks.
     */
    public val healthCheckTarget: Output
        get() = javaResource.healthCheckTarget().applyValue({ args0 -> args0 })

    /**
     * Specifies the ICMP echo type for the health check. Available values: `request`, `reply`.
     */
    public val healthCheckType: Output
        get() = javaResource.healthCheckType().applyValue({ args0 -> args0 })

    /**
     * 31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
     */
    public val interfaceAddress: Output
        get() = javaResource.interfaceAddress().applyValue({ args0 -> args0 })

    /**
     * Maximum Transmission Unit (MTU) in bytes for the GRE tunnel.
     */
    public val mtu: Output
        get() = javaResource.mtu().applyValue({ args0 -> args0 })

    /**
     * Name of the GRE tunnel.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Time To Live (TTL) in number of hops of the GRE tunnel.
     */
    public val ttl: Output
        get() = javaResource.ttl().applyValue({ args0 -> args0 })
}

public object GreTunnelMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.cloudflare.GreTunnel::class == javaResource::class

    override fun map(javaResource: Resource): GreTunnel = GreTunnel(
        javaResource as
            com.pulumi.cloudflare.GreTunnel,
    )
}

/**
 * @see [GreTunnel].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [GreTunnel].
 */
public suspend fun greTunnel(name: String, block: suspend GreTunnelResourceBuilder.() -> Unit): GreTunnel {
    val builder = GreTunnelResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [GreTunnel].
 * @param name The _unique_ name of the resulting resource.
 */
public fun greTunnel(name: String): GreTunnel {
    val builder = GreTunnelResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy