Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.compute.kotlin.RouterArgs.kt Maven / Gradle / Ivy
@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.RouterArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.RouterBgpArgs
import com.pulumi.gcp.compute.kotlin.inputs.RouterBgpArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* Represents a Router resource.
* To get more information about Router, see:
* * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/routers)
* * How-to Guides
* * [Google Cloud Router](https://cloud.google.com/router/docs/)
* ## Example Usage
* ### Router Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const foobarNetwork = new gcp.compute.Network("foobar", {
* name: "my-network",
* autoCreateSubnetworks: false,
* });
* const foobar = new gcp.compute.Router("foobar", {
* name: "my-router",
* network: foobarNetwork.name,
* bgp: {
* asn: 64514,
* advertiseMode: "CUSTOM",
* advertisedGroups: ["ALL_SUBNETS"],
* advertisedIpRanges: [
* {
* range: "1.2.3.4",
* },
* {
* range: "6.7.0.0/16",
* },
* ],
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* foobar_network = gcp.compute.Network("foobar",
* name="my-network",
* auto_create_subnetworks=False)
* foobar = gcp.compute.Router("foobar",
* name="my-router",
* network=foobar_network.name,
* bgp={
* "asn": 64514,
* "advertise_mode": "CUSTOM",
* "advertised_groups": ["ALL_SUBNETS"],
* "advertised_ip_ranges": [
* {
* "range": "1.2.3.4",
* },
* {
* "range": "6.7.0.0/16",
* },
* ],
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var foobarNetwork = new Gcp.Compute.Network("foobar", new()
* {
* Name = "my-network",
* AutoCreateSubnetworks = false,
* });
* var foobar = new Gcp.Compute.Router("foobar", new()
* {
* Name = "my-router",
* Network = foobarNetwork.Name,
* Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
* {
* Asn = 64514,
* AdvertiseMode = "CUSTOM",
* AdvertisedGroups = new[]
* {
* "ALL_SUBNETS",
* },
* AdvertisedIpRanges = new[]
* {
* new Gcp.Compute.Inputs.RouterBgpAdvertisedIpRangeArgs
* {
* Range = "1.2.3.4",
* },
* new Gcp.Compute.Inputs.RouterBgpAdvertisedIpRangeArgs
* {
* Range = "6.7.0.0/16",
* },
* },
* },
* });
* });
* ```
* ```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 {
* foobarNetwork, err := compute.NewNetwork(ctx, "foobar", &compute.NetworkArgs{
* Name: pulumi.String("my-network"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewRouter(ctx, "foobar", &compute.RouterArgs{
* Name: pulumi.String("my-router"),
* Network: foobarNetwork.Name,
* Bgp: &compute.RouterBgpArgs{
* Asn: pulumi.Int(64514),
* AdvertiseMode: pulumi.String("CUSTOM"),
* AdvertisedGroups: pulumi.StringArray{
* pulumi.String("ALL_SUBNETS"),
* },
* AdvertisedIpRanges: compute.RouterBgpAdvertisedIpRangeArray{
* &compute.RouterBgpAdvertisedIpRangeArgs{
* Range: pulumi.String("1.2.3.4"),
* },
* &compute.RouterBgpAdvertisedIpRangeArgs{
* Range: pulumi.String("6.7.0.0/16"),
* },
* },
* },
* })
* 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.Router;
* import com.pulumi.gcp.compute.RouterArgs;
* import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
* 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 foobarNetwork = new Network("foobarNetwork", NetworkArgs.builder()
* .name("my-network")
* .autoCreateSubnetworks(false)
* .build());
* var foobar = new Router("foobar", RouterArgs.builder()
* .name("my-router")
* .network(foobarNetwork.name())
* .bgp(RouterBgpArgs.builder()
* .asn(64514)
* .advertiseMode("CUSTOM")
* .advertisedGroups("ALL_SUBNETS")
* .advertisedIpRanges(
* RouterBgpAdvertisedIpRangeArgs.builder()
* .range("1.2.3.4")
* .build(),
* RouterBgpAdvertisedIpRangeArgs.builder()
* .range("6.7.0.0/16")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* foobar:
* type: gcp:compute:Router
* properties:
* name: my-router
* network: ${foobarNetwork.name}
* bgp:
* asn: 64514
* advertiseMode: CUSTOM
* advertisedGroups:
* - ALL_SUBNETS
* advertisedIpRanges:
* - range: 1.2.3.4
* - range: 6.7.0.0/16
* foobarNetwork:
* type: gcp:compute:Network
* name: foobar
* properties:
* name: my-network
* autoCreateSubnetworks: false
* ```
*
* ### Compute Router Encrypted Interconnect
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const network = new gcp.compute.Network("network", {
* name: "test-network",
* autoCreateSubnetworks: false,
* });
* const encrypted_interconnect_router = new gcp.compute.Router("encrypted-interconnect-router", {
* name: "test-router",
* network: network.name,
* encryptedInterconnectRouter: true,
* bgp: {
* asn: 64514,
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* network = gcp.compute.Network("network",
* name="test-network",
* auto_create_subnetworks=False)
* encrypted_interconnect_router = gcp.compute.Router("encrypted-interconnect-router",
* name="test-router",
* network=network.name,
* encrypted_interconnect_router=True,
* bgp={
* "asn": 64514,
* })
* ```
* ```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 = "test-network",
* AutoCreateSubnetworks = false,
* });
* var encrypted_interconnect_router = new Gcp.Compute.Router("encrypted-interconnect-router", new()
* {
* Name = "test-router",
* Network = network.Name,
* EncryptedInterconnectRouter = true,
* Bgp = new Gcp.Compute.Inputs.RouterBgpArgs
* {
* Asn = 64514,
* },
* });
* });
* ```
* ```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("test-network"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewRouter(ctx, "encrypted-interconnect-router", &compute.RouterArgs{
* Name: pulumi.String("test-router"),
* Network: network.Name,
* EncryptedInterconnectRouter: pulumi.Bool(true),
* Bgp: &compute.RouterBgpArgs{
* Asn: pulumi.Int(64514),
* },
* })
* 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.Router;
* import com.pulumi.gcp.compute.RouterArgs;
* import com.pulumi.gcp.compute.inputs.RouterBgpArgs;
* 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("test-network")
* .autoCreateSubnetworks(false)
* .build());
* var encrypted_interconnect_router = new Router("encrypted-interconnect-router", RouterArgs.builder()
* .name("test-router")
* .network(network.name())
* .encryptedInterconnectRouter(true)
* .bgp(RouterBgpArgs.builder()
* .asn(64514)
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* encrypted-interconnect-router:
* type: gcp:compute:Router
* properties:
* name: test-router
* network: ${network.name}
* encryptedInterconnectRouter: true
* bgp:
* asn: 64514
* network:
* type: gcp:compute:Network
* properties:
* name: test-network
* autoCreateSubnetworks: false
* ```
*
* ## Import
* Router can be imported using any of these accepted formats:
* * `projects/{{project}}/regions/{{region}}/routers/{{name}}`
* * `{{project}}/{{region}}/{{name}}`
* * `{{region}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, Router can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:compute/router:Router default projects/{{project}}/regions/{{region}}/routers/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/router:Router default {{project}}/{{region}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/router:Router default {{region}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/router:Router default {{name}}
* ```
* @property bgp BGP information specific to this router.
* Structure is documented below.
* @property description An optional description of this resource.
* @property encryptedInterconnectRouter Indicates if a router is dedicated for use with encrypted VLAN
* attachments (interconnectAttachments).
* @property name Name of the resource. 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 A reference to the network to which this router belongs.
* - - -
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property region Region where the router resides.
*/
public data class RouterArgs(
public val bgp: Output? = null,
public val description: Output? = null,
public val encryptedInterconnectRouter: Output? = null,
public val name: Output? = null,
public val network: Output? = null,
public val project: Output? = null,
public val region: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.RouterArgs =
com.pulumi.gcp.compute.RouterArgs.builder()
.bgp(bgp?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.description(description?.applyValue({ args0 -> args0 }))
.encryptedInterconnectRouter(encryptedInterconnectRouter?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.network(network?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.region(region?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [RouterArgs].
*/
@PulumiTagMarker
public class RouterArgsBuilder internal constructor() {
private var bgp: Output? = null
private var description: Output? = null
private var encryptedInterconnectRouter: Output? = null
private var name: Output? = null
private var network: Output? = null
private var project: Output? = null
private var region: Output? = null
/**
* @param value BGP information specific to this router.
* Structure is documented below.
*/
@JvmName("dhknyhxotiefagpx")
public suspend fun bgp(`value`: Output) {
this.bgp = value
}
/**
* @param value An optional description of this resource.
*/
@JvmName("tfakoyluebttvgqw")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value Indicates if a router is dedicated for use with encrypted VLAN
* attachments (interconnectAttachments).
*/
@JvmName("uirvwsocvreygsux")
public suspend fun encryptedInterconnectRouter(`value`: Output) {
this.encryptedInterconnectRouter = value
}
/**
* @param value Name of the resource. 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("uvepwwpfllvyephj")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value A reference to the network to which this router belongs.
* - - -
*/
@JvmName("egwcybjghprwsgqo")
public suspend fun network(`value`: Output) {
this.network = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("mydvdmcalalwbcmb")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value Region where the router resides.
*/
@JvmName("pymabdfsixvpymla")
public suspend fun region(`value`: Output) {
this.region = value
}
/**
* @param value BGP information specific to this router.
* Structure is documented below.
*/
@JvmName("djgyqmhbquauwowk")
public suspend fun bgp(`value`: RouterBgpArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.bgp = mapped
}
/**
* @param argument BGP information specific to this router.
* Structure is documented below.
*/
@JvmName("sweiiejxcqvgxxgb")
public suspend fun bgp(argument: suspend RouterBgpArgsBuilder.() -> Unit) {
val toBeMapped = RouterBgpArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.bgp = mapped
}
/**
* @param value An optional description of this resource.
*/
@JvmName("goixybequcpyeyse")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value Indicates if a router is dedicated for use with encrypted VLAN
* attachments (interconnectAttachments).
*/
@JvmName("vtuewcoahrnmhthg")
public suspend fun encryptedInterconnectRouter(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.encryptedInterconnectRouter = mapped
}
/**
* @param value Name of the resource. 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("afebbbwucrqkkpxr")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value A reference to the network to which this router belongs.
* - - -
*/
@JvmName("tfwajifmglluorta")
public suspend fun network(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.network = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("pcsnfeeolvkashhl")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value Region where the router resides.
*/
@JvmName("qmgewgilirbcqkoi")
public suspend fun region(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.region = mapped
}
internal fun build(): RouterArgs = RouterArgs(
bgp = bgp,
description = description,
encryptedInterconnectRouter = encryptedInterconnectRouter,
name = name,
network = network,
project = project,
region = region,
)
}