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

com.pulumi.gcp.compute.kotlin.TargetTCPProxyArgs.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.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.TargetTCPProxyArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Represents a TargetTcpProxy resource, which is used by one or more
 * global forwarding rule to route incoming TCP requests to a Backend
 * service.
 * To get more information about TargetTcpProxy, see:
 * * [API documentation](https://cloud.google.com/compute/docs/reference/v1/targetTcpProxies)
 * * How-to Guides
 *     * [Setting Up TCP proxy for Google Cloud Load Balancing](https://cloud.google.com/compute/docs/load-balancing/tcp-ssl/tcp-proxy)
 * ## Example Usage
 * ### Target Tcp Proxy Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
 *     name: "health-check",
 *     timeoutSec: 1,
 *     checkIntervalSec: 1,
 *     tcpHealthCheck: {
 *         port: 443,
 *     },
 * });
 * const defaultBackendService = new gcp.compute.BackendService("default", {
 *     name: "backend-service",
 *     protocol: "TCP",
 *     timeoutSec: 10,
 *     healthChecks: defaultHealthCheck.id,
 * });
 * const _default = new gcp.compute.TargetTCPProxy("default", {
 *     name: "test-proxy",
 *     backendService: defaultBackendService.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_health_check = gcp.compute.HealthCheck("default",
 *     name="health-check",
 *     timeout_sec=1,
 *     check_interval_sec=1,
 *     tcp_health_check=gcp.compute.HealthCheckTcpHealthCheckArgs(
 *         port=443,
 *     ))
 * default_backend_service = gcp.compute.BackendService("default",
 *     name="backend-service",
 *     protocol="TCP",
 *     timeout_sec=10,
 *     health_checks=default_health_check.id)
 * default = gcp.compute.TargetTCPProxy("default",
 *     name="test-proxy",
 *     backend_service=default_backend_service.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultHealthCheck = new Gcp.Compute.HealthCheck("default", new()
 *     {
 *         Name = "health-check",
 *         TimeoutSec = 1,
 *         CheckIntervalSec = 1,
 *         TcpHealthCheck = new Gcp.Compute.Inputs.HealthCheckTcpHealthCheckArgs
 *         {
 *             Port = 443,
 *         },
 *     });
 *     var defaultBackendService = new Gcp.Compute.BackendService("default", new()
 *     {
 *         Name = "backend-service",
 *         Protocol = "TCP",
 *         TimeoutSec = 10,
 *         HealthChecks = defaultHealthCheck.Id,
 *     });
 *     var @default = new Gcp.Compute.TargetTCPProxy("default", new()
 *     {
 *         Name = "test-proxy",
 *         BackendService = defaultBackendService.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		defaultHealthCheck, err := compute.NewHealthCheck(ctx, "default", &compute.HealthCheckArgs{
 * 			Name:             pulumi.String("health-check"),
 * 			TimeoutSec:       pulumi.Int(1),
 * 			CheckIntervalSec: pulumi.Int(1),
 * 			TcpHealthCheck: &compute.HealthCheckTcpHealthCheckArgs{
 * 				Port: pulumi.Int(443),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultBackendService, err := compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
 * 			Name:         pulumi.String("backend-service"),
 * 			Protocol:     pulumi.String("TCP"),
 * 			TimeoutSec:   pulumi.Int(10),
 * 			HealthChecks: defaultHealthCheck.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewTargetTCPProxy(ctx, "default", &compute.TargetTCPProxyArgs{
 * 			Name:           pulumi.String("test-proxy"),
 * 			BackendService: defaultBackendService.ID(),
 * 		})
 * 		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.gcp.compute.HealthCheck;
 * import com.pulumi.gcp.compute.HealthCheckArgs;
 * import com.pulumi.gcp.compute.inputs.HealthCheckTcpHealthCheckArgs;
 * import com.pulumi.gcp.compute.BackendService;
 * import com.pulumi.gcp.compute.BackendServiceArgs;
 * import com.pulumi.gcp.compute.TargetTCPProxy;
 * import com.pulumi.gcp.compute.TargetTCPProxyArgs;
 * 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 defaultHealthCheck = new HealthCheck("defaultHealthCheck", HealthCheckArgs.builder()
 *             .name("health-check")
 *             .timeoutSec(1)
 *             .checkIntervalSec(1)
 *             .tcpHealthCheck(HealthCheckTcpHealthCheckArgs.builder()
 *                 .port("443")
 *                 .build())
 *             .build());
 *         var defaultBackendService = new BackendService("defaultBackendService", BackendServiceArgs.builder()
 *             .name("backend-service")
 *             .protocol("TCP")
 *             .timeoutSec(10)
 *             .healthChecks(defaultHealthCheck.id())
 *             .build());
 *         var default_ = new TargetTCPProxy("default", TargetTCPProxyArgs.builder()
 *             .name("test-proxy")
 *             .backendService(defaultBackendService.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:TargetTCPProxy
 *     properties:
 *       name: test-proxy
 *       backendService: ${defaultBackendService.id}
 *   defaultBackendService:
 *     type: gcp:compute:BackendService
 *     name: default
 *     properties:
 *       name: backend-service
 *       protocol: TCP
 *       timeoutSec: 10
 *       healthChecks: ${defaultHealthCheck.id}
 *   defaultHealthCheck:
 *     type: gcp:compute:HealthCheck
 *     name: default
 *     properties:
 *       name: health-check
 *       timeoutSec: 1
 *       checkIntervalSec: 1
 *       tcpHealthCheck:
 *         port: '443'
 * ```
 * 
 * ## Import
 * TargetTcpProxy can be imported using any of these accepted formats:
 * * `projects/{{project}}/global/targetTcpProxies/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, TargetTcpProxy can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/targetTCPProxy:TargetTCPProxy default projects/{{project}}/global/targetTcpProxies/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/targetTCPProxy:TargetTCPProxy default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/targetTCPProxy:TargetTCPProxy default {{name}}
 * ```
 * @property backendService A reference to the BackendService resource.
 * - - -
 * @property description An optional description of this resource.
 * @property name Name of the resource. Provided by the client when the resource is
 * created. The name must be 1-63 characters long, and comply with
 * RFC1035. Specifically, the name must be 1-63 characters long and match
 * the regular expression `a-z?` which means the
 * first character must be a lowercase letter, and all following
 * characters must be a dash, lowercase letter, or digit, except the last
 * character, which cannot be a dash.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property proxyBind This field only applies when the forwarding rule that references
 * this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
 * @property proxyHeader Specifies the type of proxy header to append before sending data to
 * the backend.
 * Default value is `NONE`.
 * Possible values are: `NONE`, `PROXY_V1`.
 */
public data class TargetTCPProxyArgs(
    public val backendService: Output? = null,
    public val description: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val proxyBind: Output? = null,
    public val proxyHeader: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.TargetTCPProxyArgs =
        com.pulumi.gcp.compute.TargetTCPProxyArgs.builder()
            .backendService(backendService?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .proxyBind(proxyBind?.applyValue({ args0 -> args0 }))
            .proxyHeader(proxyHeader?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [TargetTCPProxyArgs].
 */
@PulumiTagMarker
public class TargetTCPProxyArgsBuilder internal constructor() {
    private var backendService: Output? = null

    private var description: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var proxyBind: Output? = null

    private var proxyHeader: Output? = null

    /**
     * @param value A reference to the BackendService resource.
     * - - -
     */
    @JvmName("mromxybxdetfawfq")
    public suspend fun backendService(`value`: Output) {
        this.backendService = value
    }

    /**
     * @param value An optional description of this resource.
     */
    @JvmName("wuafplhxyooypbck")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Name of the resource. Provided by the client when the resource is
     * created. The name must be 1-63 characters long, and comply with
     * RFC1035. Specifically, the name must be 1-63 characters long and match
     * the regular expression `a-z?` which means the
     * first character must be a lowercase letter, and all following
     * characters must be a dash, lowercase letter, or digit, except the last
     * character, which cannot be a dash.
     */
    @JvmName("hekgypluoeqejjpg")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("mlwmwvtkhseekmjm")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value This field only applies when the forwarding rule that references
     * this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
     */
    @JvmName("kmerfcrkdqbsyxiq")
    public suspend fun proxyBind(`value`: Output) {
        this.proxyBind = value
    }

    /**
     * @param value Specifies the type of proxy header to append before sending data to
     * the backend.
     * Default value is `NONE`.
     * Possible values are: `NONE`, `PROXY_V1`.
     */
    @JvmName("tvrojihcwjgcewbp")
    public suspend fun proxyHeader(`value`: Output) {
        this.proxyHeader = value
    }

    /**
     * @param value A reference to the BackendService resource.
     * - - -
     */
    @JvmName("uqoilgyavclafdny")
    public suspend fun backendService(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backendService = mapped
    }

    /**
     * @param value An optional description of this resource.
     */
    @JvmName("heiknfrpbuqiwhbd")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Name of the resource. Provided by the client when the resource is
     * created. The name must be 1-63 characters long, and comply with
     * RFC1035. Specifically, the name must be 1-63 characters long and match
     * the regular expression `a-z?` which means the
     * first character must be a lowercase letter, and all following
     * characters must be a dash, lowercase letter, or digit, except the last
     * character, which cannot be a dash.
     */
    @JvmName("qqryapeculualebf")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("edbmyfamploguenq")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value This field only applies when the forwarding rule that references
     * this target proxy has a loadBalancingScheme set to INTERNAL_SELF_MANAGED.
     */
    @JvmName("dnbspobcjsyrulvv")
    public suspend fun proxyBind(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.proxyBind = mapped
    }

    /**
     * @param value Specifies the type of proxy header to append before sending data to
     * the backend.
     * Default value is `NONE`.
     * Possible values are: `NONE`, `PROXY_V1`.
     */
    @JvmName("diolmyrlguareamr")
    public suspend fun proxyHeader(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.proxyHeader = mapped
    }

    internal fun build(): TargetTCPProxyArgs = TargetTCPProxyArgs(
        backendService = backendService,
        description = description,
        name = name,
        project = project,
        proxyBind = proxyBind,
        proxyHeader = proxyHeader,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy