com.pulumi.gcp.compute.kotlin.GlobalAddress.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.compute.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
import kotlin.collections.Map
/**
* Builder for [GlobalAddress].
*/
@PulumiTagMarker
public class GlobalAddressResourceBuilder internal constructor() {
public var name: String? = null
public var args: GlobalAddressArgs = GlobalAddressArgs()
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 GlobalAddressArgsBuilder.() -> Unit) {
val builder = GlobalAddressArgsBuilder()
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(): GlobalAddress {
val builtJavaResource = com.pulumi.gcp.compute.GlobalAddress(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return GlobalAddress(builtJavaResource)
}
}
/**
* 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}}
* ```
*/
public class GlobalAddress internal constructor(
override val javaResource: com.pulumi.gcp.compute.GlobalAddress,
) : KotlinCustomResource(javaResource, GlobalAddressMapper) {
/**
* 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.
*/
public val address: Output
get() = javaResource.address().applyValue({ args0 -> args0 })
/**
* 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`.
*/
public val addressType: Output?
get() = javaResource.addressType().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Creation timestamp in RFC3339 text format.
*/
public val creationTimestamp: Output
get() = javaResource.creationTimestamp().applyValue({ args0 -> args0 })
/**
* An optional description of this resource.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
public val effectiveLabels: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy