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

com.pulumi.gcp.compute.kotlin.GlobalNetworkEndpointArgs.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.12.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.GlobalNetworkEndpointArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * A Global Network endpoint represents a IP address and port combination that exists outside of GCP.
 * **NOTE**: Global network endpoints cannot be created outside of a
 * global network endpoint group.
 * To get more information about GlobalNetworkEndpoint, see:
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/networkEndpointGroups)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/load-balancing/docs/negs/)
 * ## Example Usage
 * ### Global Network Endpoint
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const neg = new gcp.compute.GlobalNetworkEndpointGroup("neg", {
 *     name: "my-lb-neg",
 *     defaultPort: 90,
 *     networkEndpointType: "INTERNET_FQDN_PORT",
 * });
 * const default_endpoint = new gcp.compute.GlobalNetworkEndpoint("default-endpoint", {
 *     globalNetworkEndpointGroup: neg.name,
 *     fqdn: "www.example.com",
 *     port: 90,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * neg = gcp.compute.GlobalNetworkEndpointGroup("neg",
 *     name="my-lb-neg",
 *     default_port=90,
 *     network_endpoint_type="INTERNET_FQDN_PORT")
 * default_endpoint = gcp.compute.GlobalNetworkEndpoint("default-endpoint",
 *     global_network_endpoint_group=neg.name,
 *     fqdn="www.example.com",
 *     port=90)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var neg = new Gcp.Compute.GlobalNetworkEndpointGroup("neg", new()
 *     {
 *         Name = "my-lb-neg",
 *         DefaultPort = 90,
 *         NetworkEndpointType = "INTERNET_FQDN_PORT",
 *     });
 *     var default_endpoint = new Gcp.Compute.GlobalNetworkEndpoint("default-endpoint", new()
 *     {
 *         GlobalNetworkEndpointGroup = neg.Name,
 *         Fqdn = "www.example.com",
 *         Port = 90,
 *     });
 * });
 * ```
 * ```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 {
 * 		neg, err := compute.NewGlobalNetworkEndpointGroup(ctx, "neg", &compute.GlobalNetworkEndpointGroupArgs{
 * 			Name:                pulumi.String("my-lb-neg"),
 * 			DefaultPort:         pulumi.Int(90),
 * 			NetworkEndpointType: pulumi.String("INTERNET_FQDN_PORT"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewGlobalNetworkEndpoint(ctx, "default-endpoint", &compute.GlobalNetworkEndpointArgs{
 * 			GlobalNetworkEndpointGroup: neg.Name,
 * 			Fqdn:                       pulumi.String("www.example.com"),
 * 			Port:                       pulumi.Int(90),
 * 		})
 * 		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.GlobalNetworkEndpointGroup;
 * import com.pulumi.gcp.compute.GlobalNetworkEndpointGroupArgs;
 * import com.pulumi.gcp.compute.GlobalNetworkEndpoint;
 * import com.pulumi.gcp.compute.GlobalNetworkEndpointArgs;
 * 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 neg = new GlobalNetworkEndpointGroup("neg", GlobalNetworkEndpointGroupArgs.builder()
 *             .name("my-lb-neg")
 *             .defaultPort("90")
 *             .networkEndpointType("INTERNET_FQDN_PORT")
 *             .build());
 *         var default_endpoint = new GlobalNetworkEndpoint("default-endpoint", GlobalNetworkEndpointArgs.builder()
 *             .globalNetworkEndpointGroup(neg.name())
 *             .fqdn("www.example.com")
 *             .port(90)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default-endpoint:
 *     type: gcp:compute:GlobalNetworkEndpoint
 *     properties:
 *       globalNetworkEndpointGroup: ${neg.name}
 *       fqdn: www.example.com
 *       port: 90
 *   neg:
 *     type: gcp:compute:GlobalNetworkEndpointGroup
 *     properties:
 *       name: my-lb-neg
 *       defaultPort: '90'
 *       networkEndpointType: INTERNET_FQDN_PORT
 * ```
 * 
 * ## Import
 * GlobalNetworkEndpoint can be imported using any of these accepted formats:
 * * `projects/{{project}}/global/networkEndpointGroups/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}`
 * * `{{project}}/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}`
 * * `{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}`
 * When using the `pulumi import` command, GlobalNetworkEndpoint can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/globalNetworkEndpoint:GlobalNetworkEndpoint default projects/{{project}}/global/networkEndpointGroups/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/globalNetworkEndpoint:GlobalNetworkEndpoint default {{project}}/{{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/globalNetworkEndpoint:GlobalNetworkEndpoint default {{global_network_endpoint_group}}/{{ip_address}}/{{fqdn}}/{{port}}
 * ```
 * @property fqdn Fully qualified domain name of network endpoint.
 * This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
 * @property globalNetworkEndpointGroup The global network endpoint group this endpoint is part of.
 * - - -
 * @property ipAddress IPv4 address external endpoint.
 * @property port Port number of the external endpoint.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 */
public data class GlobalNetworkEndpointArgs(
    public val fqdn: Output? = null,
    public val globalNetworkEndpointGroup: Output? = null,
    public val ipAddress: Output? = null,
    public val port: Output? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.GlobalNetworkEndpointArgs =
        com.pulumi.gcp.compute.GlobalNetworkEndpointArgs.builder()
            .fqdn(fqdn?.applyValue({ args0 -> args0 }))
            .globalNetworkEndpointGroup(globalNetworkEndpointGroup?.applyValue({ args0 -> args0 }))
            .ipAddress(ipAddress?.applyValue({ args0 -> args0 }))
            .port(port?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [GlobalNetworkEndpointArgs].
 */
@PulumiTagMarker
public class GlobalNetworkEndpointArgsBuilder internal constructor() {
    private var fqdn: Output? = null

    private var globalNetworkEndpointGroup: Output? = null

    private var ipAddress: Output? = null

    private var port: Output? = null

    private var project: Output? = null

    /**
     * @param value Fully qualified domain name of network endpoint.
     * This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
     */
    @JvmName("omgserfeadvcagpr")
    public suspend fun fqdn(`value`: Output) {
        this.fqdn = value
    }

    /**
     * @param value The global network endpoint group this endpoint is part of.
     * - - -
     */
    @JvmName("skltsbgjbxrjqetm")
    public suspend fun globalNetworkEndpointGroup(`value`: Output) {
        this.globalNetworkEndpointGroup = value
    }

    /**
     * @param value IPv4 address external endpoint.
     */
    @JvmName("wfxpcktdbhoihwyb")
    public suspend fun ipAddress(`value`: Output) {
        this.ipAddress = value
    }

    /**
     * @param value Port number of the external endpoint.
     */
    @JvmName("gacklgjwncjqkewb")
    public suspend fun port(`value`: Output) {
        this.port = value
    }

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

    /**
     * @param value Fully qualified domain name of network endpoint.
     * This can only be specified when network_endpoint_type of the NEG is INTERNET_FQDN_PORT.
     */
    @JvmName("okpqmfsnfcxkwwfx")
    public suspend fun fqdn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.fqdn = mapped
    }

    /**
     * @param value The global network endpoint group this endpoint is part of.
     * - - -
     */
    @JvmName("clooybwrlwuvoofb")
    public suspend fun globalNetworkEndpointGroup(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.globalNetworkEndpointGroup = mapped
    }

    /**
     * @param value IPv4 address external endpoint.
     */
    @JvmName("gjffswcnbmohasgl")
    public suspend fun ipAddress(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipAddress = mapped
    }

    /**
     * @param value Port number of the external endpoint.
     */
    @JvmName("rjesspuijgccchhi")
    public suspend fun port(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.port = mapped
    }

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

    internal fun build(): GlobalNetworkEndpointArgs = GlobalNetworkEndpointArgs(
        fqdn = fqdn,
        globalNetworkEndpointGroup = globalNetworkEndpointGroup,
        ipAddress = ipAddress,
        port = port,
        project = project,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy