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

com.pulumi.gcp.compute.kotlin.GlobalAddressArgs.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.GlobalAddressArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Represents a Global Address resource. Global addresses are used for
 * HTTP(S) load balancing.
 * To get more information about GlobalAddress, see:
 * * [API documentation](https://cloud.google.com/compute/docs/reference/v1/globalAddresses)
 * * How-to Guides
 *     * [Reserving a Static External IP Address](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-external-ip-address)
 * ## Example Usage
 * ### Global Address Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const _default = new gcp.compute.GlobalAddress("default", {name: "global-appserver-ip"});
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default = gcp.compute.GlobalAddress("default", name="global-appserver-ip")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Compute.GlobalAddress("default", new()
 *     {
 *         Name = "global-appserver-ip",
 *     });
 * });
 * ```
 * ```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 {
 * 		_, err := compute.NewGlobalAddress(ctx, "default", &compute.GlobalAddressArgs{
 * 			Name: pulumi.String("global-appserver-ip"),
 * 		})
 * 		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.GlobalAddress;
 * import com.pulumi.gcp.compute.GlobalAddressArgs;
 * 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 default_ = new GlobalAddress("default", GlobalAddressArgs.builder()
 *             .name("global-appserver-ip")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:GlobalAddress
 *     properties:
 *       name: global-appserver-ip
 * ```
 * 
 * ### Global Address Private Services Connect
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const network = new gcp.compute.Network("network", {
 *     name: "my-network-name",
 *     autoCreateSubnetworks: false,
 * });
 * const _default = new gcp.compute.GlobalAddress("default", {
 *     name: "global-psconnect-ip",
 *     addressType: "INTERNAL",
 *     purpose: "PRIVATE_SERVICE_CONNECT",
 *     network: network.id,
 *     address: "100.100.100.105",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * network = gcp.compute.Network("network",
 *     name="my-network-name",
 *     auto_create_subnetworks=False)
 * default = gcp.compute.GlobalAddress("default",
 *     name="global-psconnect-ip",
 *     address_type="INTERNAL",
 *     purpose="PRIVATE_SERVICE_CONNECT",
 *     network=network.id,
 *     address="100.100.100.105")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var network = new Gcp.Compute.Network("network", new()
 *     {
 *         Name = "my-network-name",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var @default = new Gcp.Compute.GlobalAddress("default", new()
 *     {
 *         Name = "global-psconnect-ip",
 *         AddressType = "INTERNAL",
 *         Purpose = "PRIVATE_SERVICE_CONNECT",
 *         Network = network.Id,
 *         Address = "100.100.100.105",
 *     });
 * });
 * ```
 * ```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 {
 * 		network, err := compute.NewNetwork(ctx, "network", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("my-network-name"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewGlobalAddress(ctx, "default", &compute.GlobalAddressArgs{
 * 			Name:        pulumi.String("global-psconnect-ip"),
 * 			AddressType: pulumi.String("INTERNAL"),
 * 			Purpose:     pulumi.String("PRIVATE_SERVICE_CONNECT"),
 * 			Network:     network.ID(),
 * 			Address:     pulumi.String("100.100.100.105"),
 * 		})
 * 		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.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.GlobalAddress;
 * import com.pulumi.gcp.compute.GlobalAddressArgs;
 * 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 network = new Network("network", NetworkArgs.builder()
 *             .name("my-network-name")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var default_ = new GlobalAddress("default", GlobalAddressArgs.builder()
 *             .name("global-psconnect-ip")
 *             .addressType("INTERNAL")
 *             .purpose("PRIVATE_SERVICE_CONNECT")
 *             .network(network.id())
 *             .address("100.100.100.105")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:GlobalAddress
 *     properties:
 *       name: global-psconnect-ip
 *       addressType: INTERNAL
 *       purpose: PRIVATE_SERVICE_CONNECT
 *       network: ${network.id}
 *       address: 100.100.100.105
 *   network:
 *     type: gcp:compute:Network
 *     properties:
 *       name: my-network-name
 *       autoCreateSubnetworks: false
 * ```
 * 
 * ## Import
 * GlobalAddress can be imported using any of these accepted formats:
 * * `projects/{{project}}/global/addresses/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, GlobalAddress can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/globalAddress:GlobalAddress default projects/{{project}}/global/addresses/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/globalAddress:GlobalAddress default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/globalAddress:GlobalAddress default {{name}}
 * ```
 * @property address The IP address or beginning of the address range represented by this
 * resource. This can be supplied as an input to reserve a specific
 * address or omitted to allow GCP to choose a valid one for you.
 * @property addressType The type of the address to reserve.
 * * EXTERNAL indicates public/external single IP address.
 * * INTERNAL indicates internal IP ranges belonging to some network.
 * Default value is `EXTERNAL`.
 * Possible values are: `EXTERNAL`, `INTERNAL`.
 * @property description An optional description of this resource.
 * @property ipVersion The IP Version that will be used by this address. The default value is `IPV4`.
 * Possible values are: `IPV4`, `IPV6`.
 * @property labels Labels to apply to this address.  A list of key->value pairs.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the 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 network The URL of the network in which to reserve the IP range. The IP range
 * must be in RFC1918 space. The network cannot be deleted if there are
 * any reserved IP ranges referring to it.
 * This should only be set when using an Internal address.
 * @property prefixLength The prefix length of the IP range. If not present, it means the
 * address field is a single IP address.
 * This field is not applicable to addresses with addressType=INTERNAL
 * when purpose=PRIVATE_SERVICE_CONNECT
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property purpose The purpose of the resource. Possible values include:
 * * VPC_PEERING - for peer networks
 * * PRIVATE_SERVICE_CONNECT - for  Private Service Connect networks
 */
public data class GlobalAddressArgs(
    public val address: Output? = null,
    public val addressType: Output? = null,
    public val description: Output? = null,
    public val ipVersion: Output? = null,
    public val labels: Output>? = null,
    public val name: Output? = null,
    public val network: Output? = null,
    public val prefixLength: Output? = null,
    public val project: Output? = null,
    public val purpose: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.GlobalAddressArgs =
        com.pulumi.gcp.compute.GlobalAddressArgs.builder()
            .address(address?.applyValue({ args0 -> args0 }))
            .addressType(addressType?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .ipVersion(ipVersion?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .name(name?.applyValue({ args0 -> args0 }))
            .network(network?.applyValue({ args0 -> args0 }))
            .prefixLength(prefixLength?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .purpose(purpose?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [GlobalAddressArgs].
 */
@PulumiTagMarker
public class GlobalAddressArgsBuilder internal constructor() {
    private var address: Output? = null

    private var addressType: Output? = null

    private var description: Output? = null

    private var ipVersion: Output? = null

    private var labels: Output>? = null

    private var name: Output? = null

    private var network: Output? = null

    private var prefixLength: Output? = null

    private var project: Output? = null

    private var purpose: Output? = null

    /**
     * @param value The IP address or beginning of the address range represented by this
     * resource. This can be supplied as an input to reserve a specific
     * address or omitted to allow GCP to choose a valid one for you.
     */
    @JvmName("riwhluqmpdbvpsll")
    public suspend fun address(`value`: Output) {
        this.address = value
    }

    /**
     * @param value The type of the address to reserve.
     * * EXTERNAL indicates public/external single IP address.
     * * INTERNAL indicates internal IP ranges belonging to some network.
     * Default value is `EXTERNAL`.
     * Possible values are: `EXTERNAL`, `INTERNAL`.
     */
    @JvmName("gllnyqcwkatdaegw")
    public suspend fun addressType(`value`: Output) {
        this.addressType = value
    }

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

    /**
     * @param value The IP Version that will be used by this address. The default value is `IPV4`.
     * Possible values are: `IPV4`, `IPV6`.
     */
    @JvmName("qucyodqmlblpfmoa")
    public suspend fun ipVersion(`value`: Output) {
        this.ipVersion = value
    }

    /**
     * @param value Labels to apply to this address.  A list of key->value pairs.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("sjgoywekfygncsks")
    public suspend fun labels(`value`: Output>) {
        this.labels = 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("xbhqjwedjatdoblt")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The URL of the network in which to reserve the IP range. The IP range
     * must be in RFC1918 space. The network cannot be deleted if there are
     * any reserved IP ranges referring to it.
     * This should only be set when using an Internal address.
     */
    @JvmName("bphkaakgkbokentt")
    public suspend fun network(`value`: Output) {
        this.network = value
    }

    /**
     * @param value The prefix length of the IP range. If not present, it means the
     * address field is a single IP address.
     * This field is not applicable to addresses with addressType=INTERNAL
     * when purpose=PRIVATE_SERVICE_CONNECT
     */
    @JvmName("mxkemdselfsbhana")
    public suspend fun prefixLength(`value`: Output) {
        this.prefixLength = value
    }

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

    /**
     * @param value The purpose of the resource. Possible values include:
     * * VPC_PEERING - for peer networks
     * * PRIVATE_SERVICE_CONNECT - for  Private Service Connect networks
     */
    @JvmName("ckxppngerfgybidr")
    public suspend fun purpose(`value`: Output) {
        this.purpose = value
    }

    /**
     * @param value The IP address or beginning of the address range represented by this
     * resource. This can be supplied as an input to reserve a specific
     * address or omitted to allow GCP to choose a valid one for you.
     */
    @JvmName("jdmkqstrlypkyjlx")
    public suspend fun address(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.address = mapped
    }

    /**
     * @param value The type of the address to reserve.
     * * EXTERNAL indicates public/external single IP address.
     * * INTERNAL indicates internal IP ranges belonging to some network.
     * Default value is `EXTERNAL`.
     * Possible values are: `EXTERNAL`, `INTERNAL`.
     */
    @JvmName("yvwjfbxwsacrynse")
    public suspend fun addressType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.addressType = mapped
    }

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

    /**
     * @param value The IP Version that will be used by this address. The default value is `IPV4`.
     * Possible values are: `IPV4`, `IPV6`.
     */
    @JvmName("qynmipobfjrmhuhg")
    public suspend fun ipVersion(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ipVersion = mapped
    }

    /**
     * @param value Labels to apply to this address.  A list of key->value pairs.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("lmnsagsnmfthohvd")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Labels to apply to this address.  A list of key->value pairs.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("agtwmakxwapmvaqm")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = 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("dauvndvkhxadyxnr")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The URL of the network in which to reserve the IP range. The IP range
     * must be in RFC1918 space. The network cannot be deleted if there are
     * any reserved IP ranges referring to it.
     * This should only be set when using an Internal address.
     */
    @JvmName("rejlulxxaokkshkk")
    public suspend fun network(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.network = mapped
    }

    /**
     * @param value The prefix length of the IP range. If not present, it means the
     * address field is a single IP address.
     * This field is not applicable to addresses with addressType=INTERNAL
     * when purpose=PRIVATE_SERVICE_CONNECT
     */
    @JvmName("rmdqjnhfehisdyus")
    public suspend fun prefixLength(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.prefixLength = mapped
    }

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

    /**
     * @param value The purpose of the resource. Possible values include:
     * * VPC_PEERING - for peer networks
     * * PRIVATE_SERVICE_CONNECT - for  Private Service Connect networks
     */
    @JvmName("ipcnalunxpgryaqd")
    public suspend fun purpose(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.purpose = mapped
    }

    internal fun build(): GlobalAddressArgs = GlobalAddressArgs(
        address = address,
        addressType = addressType,
        description = description,
        ipVersion = ipVersion,
        labels = labels,
        name = name,
        network = network,
        prefixLength = prefixLength,
        project = project,
        purpose = purpose,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy