com.pulumi.cloudflare.kotlin.TunnelConfigArgs.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.TunnelConfigArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.TunnelConfigConfigArgs
import com.pulumi.cloudflare.kotlin.inputs.TunnelConfigConfigArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* Provides a Cloudflare Tunnel configuration resource.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* const exampleTunnel = new cloudflare.ZeroTrustTunnelCloudflared("example_tunnel", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "example_tunnel",
* secret: "<32 character secret>",
* });
* const exampleConfig = new cloudflare.TunnelConfig("example_config", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* tunnelId: exampleTunnel.id,
* config: {
* warpRouting: {
* enabled: true,
* },
* originRequest: {
* connectTimeout: "1m0s",
* tlsTimeout: "1m0s",
* tcpKeepAlive: "1m0s",
* noHappyEyeballs: false,
* keepAliveConnections: 1024,
* keepAliveTimeout: "1m0s",
* httpHostHeader: "baz",
* originServerName: "foobar",
* caPool: "/path/to/unsigned/ca/pool",
* noTlsVerify: false,
* disableChunkedEncoding: false,
* bastionMode: false,
* proxyAddress: "10.0.0.1",
* proxyPort: 8123,
* proxyType: "socks",
* ipRules: [{
* prefix: "/web",
* ports: [
* 80,
* 443,
* ],
* allow: false,
* }],
* },
* ingressRules: [
* {
* hostname: "foo",
* path: "/bar",
* service: "http://10.0.0.2:8080",
* originRequest: {
* connectTimeout: "2m0s",
* access: {
* required: true,
* teamName: "terraform",
* audTags: ["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"],
* },
* },
* },
* {
* service: "https://10.0.0.3:8081",
* },
* ],
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* example_tunnel = cloudflare.ZeroTrustTunnelCloudflared("example_tunnel",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="example_tunnel",
* secret="<32 character secret>")
* example_config = cloudflare.TunnelConfig("example_config",
* account_id="f037e56e89293a057740de681ac9abbe",
* tunnel_id=example_tunnel.id,
* config={
* "warp_routing": {
* "enabled": True,
* },
* "origin_request": {
* "connect_timeout": "1m0s",
* "tls_timeout": "1m0s",
* "tcp_keep_alive": "1m0s",
* "no_happy_eyeballs": False,
* "keep_alive_connections": 1024,
* "keep_alive_timeout": "1m0s",
* "http_host_header": "baz",
* "origin_server_name": "foobar",
* "ca_pool": "/path/to/unsigned/ca/pool",
* "no_tls_verify": False,
* "disable_chunked_encoding": False,
* "bastion_mode": False,
* "proxy_address": "10.0.0.1",
* "proxy_port": 8123,
* "proxy_type": "socks",
* "ip_rules": [{
* "prefix": "/web",
* "ports": [
* 80,
* 443,
* ],
* "allow": False,
* }],
* },
* "ingress_rules": [
* {
* "hostname": "foo",
* "path": "/bar",
* "service": "http://10.0.0.2:8080",
* "origin_request": {
* "connect_timeout": "2m0s",
* "access": {
* "required": True,
* "team_name": "terraform",
* "aud_tags": ["AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"],
* },
* },
* },
* {
* "service": "https://10.0.0.3:8081",
* },
* ],
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* var exampleTunnel = new Cloudflare.ZeroTrustTunnelCloudflared("example_tunnel", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "example_tunnel",
* Secret = "<32 character secret>",
* });
* var exampleConfig = new Cloudflare.TunnelConfig("example_config", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* TunnelId = exampleTunnel.Id,
* Config = new Cloudflare.Inputs.TunnelConfigConfigArgs
* {
* WarpRouting = new Cloudflare.Inputs.TunnelConfigConfigWarpRoutingArgs
* {
* Enabled = true,
* },
* OriginRequest = new Cloudflare.Inputs.TunnelConfigConfigOriginRequestArgs
* {
* ConnectTimeout = "1m0s",
* TlsTimeout = "1m0s",
* TcpKeepAlive = "1m0s",
* NoHappyEyeballs = false,
* KeepAliveConnections = 1024,
* KeepAliveTimeout = "1m0s",
* HttpHostHeader = "baz",
* OriginServerName = "foobar",
* CaPool = "/path/to/unsigned/ca/pool",
* NoTlsVerify = false,
* DisableChunkedEncoding = false,
* BastionMode = false,
* ProxyAddress = "10.0.0.1",
* ProxyPort = 8123,
* ProxyType = "socks",
* IpRules = new[]
* {
* new Cloudflare.Inputs.TunnelConfigConfigOriginRequestIpRuleArgs
* {
* Prefix = "/web",
* Ports = new[]
* {
* 80,
* 443,
* },
* Allow = false,
* },
* },
* },
* IngressRules = new[]
* {
* new Cloudflare.Inputs.TunnelConfigConfigIngressRuleArgs
* {
* Hostname = "foo",
* Path = "/bar",
* Service = "http://10.0.0.2:8080",
* OriginRequest = new Cloudflare.Inputs.TunnelConfigConfigIngressRuleOriginRequestArgs
* {
* ConnectTimeout = "2m0s",
* Access = new Cloudflare.Inputs.TunnelConfigConfigIngressRuleOriginRequestAccessArgs
* {
* Required = true,
* TeamName = "terraform",
* AudTags = new[]
* {
* "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
* },
* },
* },
* },
* new Cloudflare.Inputs.TunnelConfigConfigIngressRuleArgs
* {
* Service = "https://10.0.0.3:8081",
* },
* },
* },
* });
* });
* ```
* ```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 {
* exampleTunnel, err := cloudflare.NewZeroTrustTunnelCloudflared(ctx, "example_tunnel", &cloudflare.ZeroTrustTunnelCloudflaredArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("example_tunnel"),
* Secret: pulumi.String("<32 character secret>"),
* })
* if err != nil {
* return err
* }
* _, err = cloudflare.NewTunnelConfig(ctx, "example_config", &cloudflare.TunnelConfigArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* TunnelId: exampleTunnel.ID(),
* Config: &cloudflare.TunnelConfigConfigArgs{
* WarpRouting: &cloudflare.TunnelConfigConfigWarpRoutingArgs{
* Enabled: pulumi.Bool(true),
* },
* OriginRequest: &cloudflare.TunnelConfigConfigOriginRequestArgs{
* ConnectTimeout: pulumi.String("1m0s"),
* TlsTimeout: pulumi.String("1m0s"),
* TcpKeepAlive: pulumi.String("1m0s"),
* NoHappyEyeballs: pulumi.Bool(false),
* KeepAliveConnections: pulumi.Int(1024),
* KeepAliveTimeout: pulumi.String("1m0s"),
* HttpHostHeader: pulumi.String("baz"),
* OriginServerName: pulumi.String("foobar"),
* CaPool: pulumi.String("/path/to/unsigned/ca/pool"),
* NoTlsVerify: pulumi.Bool(false),
* DisableChunkedEncoding: pulumi.Bool(false),
* BastionMode: pulumi.Bool(false),
* ProxyAddress: pulumi.String("10.0.0.1"),
* ProxyPort: pulumi.Int(8123),
* ProxyType: pulumi.String("socks"),
* IpRules: cloudflare.TunnelConfigConfigOriginRequestIpRuleArray{
* &cloudflare.TunnelConfigConfigOriginRequestIpRuleArgs{
* Prefix: pulumi.String("/web"),
* Ports: pulumi.IntArray{
* pulumi.Int(80),
* pulumi.Int(443),
* },
* Allow: pulumi.Bool(false),
* },
* },
* },
* IngressRules: cloudflare.TunnelConfigConfigIngressRuleArray{
* &cloudflare.TunnelConfigConfigIngressRuleArgs{
* Hostname: pulumi.String("foo"),
* Path: pulumi.String("/bar"),
* Service: pulumi.String("http://10.0.0.2:8080"),
* OriginRequest: &cloudflare.TunnelConfigConfigIngressRuleOriginRequestArgs{
* ConnectTimeout: pulumi.String("2m0s"),
* Access: &cloudflare.TunnelConfigConfigIngressRuleOriginRequestAccessArgs{
* Required: pulumi.Bool(true),
* TeamName: pulumi.String("terraform"),
* AudTags: pulumi.StringArray{
* pulumi.String("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"),
* },
* },
* },
* },
* &cloudflare.TunnelConfigConfigIngressRuleArgs{
* Service: pulumi.String("https://10.0.0.3:8081"),
* },
* },
* },
* })
* 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.ZeroTrustTunnelCloudflared;
* import com.pulumi.cloudflare.ZeroTrustTunnelCloudflaredArgs;
* import com.pulumi.cloudflare.TunnelConfig;
* import com.pulumi.cloudflare.TunnelConfigArgs;
* import com.pulumi.cloudflare.inputs.TunnelConfigConfigArgs;
* import com.pulumi.cloudflare.inputs.TunnelConfigConfigWarpRoutingArgs;
* import com.pulumi.cloudflare.inputs.TunnelConfigConfigOriginRequestArgs;
* 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 exampleTunnel = new ZeroTrustTunnelCloudflared("exampleTunnel", ZeroTrustTunnelCloudflaredArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("example_tunnel")
* .secret("<32 character secret>")
* .build());
* var exampleConfig = new TunnelConfig("exampleConfig", TunnelConfigArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .tunnelId(exampleTunnel.id())
* .config(TunnelConfigConfigArgs.builder()
* .warpRouting(TunnelConfigConfigWarpRoutingArgs.builder()
* .enabled(true)
* .build())
* .originRequest(TunnelConfigConfigOriginRequestArgs.builder()
* .connectTimeout("1m0s")
* .tlsTimeout("1m0s")
* .tcpKeepAlive("1m0s")
* .noHappyEyeballs(false)
* .keepAliveConnections(1024)
* .keepAliveTimeout("1m0s")
* .httpHostHeader("baz")
* .originServerName("foobar")
* .caPool("/path/to/unsigned/ca/pool")
* .noTlsVerify(false)
* .disableChunkedEncoding(false)
* .bastionMode(false)
* .proxyAddress("10.0.0.1")
* .proxyPort("8123")
* .proxyType("socks")
* .ipRules(TunnelConfigConfigOriginRequestIpRuleArgs.builder()
* .prefix("/web")
* .ports(
* 80,
* 443)
* .allow(false)
* .build())
* .build())
* .ingressRules(
* TunnelConfigConfigIngressRuleArgs.builder()
* .hostname("foo")
* .path("/bar")
* .service("http://10.0.0.2:8080")
* .originRequest(TunnelConfigConfigIngressRuleOriginRequestArgs.builder()
* .connectTimeout("2m0s")
* .access(TunnelConfigConfigIngressRuleOriginRequestAccessArgs.builder()
* .required(true)
* .teamName("terraform")
* .audTags("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
* .build())
* .build())
* .build(),
* TunnelConfigConfigIngressRuleArgs.builder()
* .service("https://10.0.0.3:8081")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleTunnel:
* type: cloudflare:ZeroTrustTunnelCloudflared
* name: example_tunnel
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: example_tunnel
* secret: <32 character secret>
* exampleConfig:
* type: cloudflare:TunnelConfig
* name: example_config
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* tunnelId: ${exampleTunnel.id}
* config:
* warpRouting:
* enabled: true
* originRequest:
* connectTimeout: 1m0s
* tlsTimeout: 1m0s
* tcpKeepAlive: 1m0s
* noHappyEyeballs: false
* keepAliveConnections: 1024
* keepAliveTimeout: 1m0s
* httpHostHeader: baz
* originServerName: foobar
* caPool: /path/to/unsigned/ca/pool
* noTlsVerify: false
* disableChunkedEncoding: false
* bastionMode: false
* proxyAddress: 10.0.0.1
* proxyPort: '8123'
* proxyType: socks
* ipRules:
* - prefix: /web
* ports:
* - 80
* - 443
* allow: false
* ingressRules:
* - hostname: foo
* path: /bar
* service: http://10.0.0.2:8080
* originRequest:
* connectTimeout: 2m0s
* access:
* required: true
* teamName: terraform
* audTags:
* - AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
* - service: https://10.0.0.3:8081
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/tunnelConfig:TunnelConfig example /
* ```
* @property accountId The account identifier to target for the resource.
* @property config Configuration block for Tunnel Configuration.
* @property tunnelId Identifier of the Tunnel to target for this configuration.
*/
public data class TunnelConfigArgs(
public val accountId: Output? = null,
public val config: Output? = null,
public val tunnelId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.TunnelConfigArgs =
com.pulumi.cloudflare.TunnelConfigArgs.builder()
.accountId(accountId?.applyValue({ args0 -> args0 }))
.config(config?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.tunnelId(tunnelId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [TunnelConfigArgs].
*/
@PulumiTagMarker
public class TunnelConfigArgsBuilder internal constructor() {
private var accountId: Output? = null
private var config: Output? = null
private var tunnelId: Output? = null
/**
* @param value The account identifier to target for the resource.
*/
@JvmName("fttxbqghyqmlfrxb")
public suspend fun accountId(`value`: Output) {
this.accountId = value
}
/**
* @param value Configuration block for Tunnel Configuration.
*/
@JvmName("eahpwrbcqcgiqxuo")
public suspend fun config(`value`: Output) {
this.config = value
}
/**
* @param value Identifier of the Tunnel to target for this configuration.
*/
@JvmName("jdvrbftbagukjlrh")
public suspend fun tunnelId(`value`: Output) {
this.tunnelId = value
}
/**
* @param value The account identifier to target for the resource.
*/
@JvmName("rtmuduokwrepdmtn")
public suspend fun accountId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.accountId = mapped
}
/**
* @param value Configuration block for Tunnel Configuration.
*/
@JvmName("qnrltlbjygjrrfab")
public suspend fun config(`value`: TunnelConfigConfigArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.config = mapped
}
/**
* @param argument Configuration block for Tunnel Configuration.
*/
@JvmName("xquiuyjpxvvyhlbi")
public suspend fun config(argument: suspend TunnelConfigConfigArgsBuilder.() -> Unit) {
val toBeMapped = TunnelConfigConfigArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.config = mapped
}
/**
* @param value Identifier of the Tunnel to target for this configuration.
*/
@JvmName("bfqgsopkjjjcnacy")
public suspend fun tunnelId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.tunnelId = mapped
}
internal fun build(): TunnelConfigArgs = TunnelConfigArgs(
accountId = accountId,
config = config,
tunnelId = tunnelId,
)
}