com.pulumi.gcp.compute.kotlin.RouterInterface.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.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [RouterInterface].
*/
@PulumiTagMarker
public class RouterInterfaceResourceBuilder internal constructor() {
public var name: String? = null
public var args: RouterInterfaceArgs = RouterInterfaceArgs()
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 RouterInterfaceArgsBuilder.() -> Unit) {
val builder = RouterInterfaceArgsBuilder()
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(): RouterInterface {
val builtJavaResource = com.pulumi.gcp.compute.RouterInterface(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return RouterInterface(builtJavaResource)
}
}
/**
* Manages a Cloud Router interface. For more information see
* [the official documentation](https://cloud.google.com/compute/docs/cloudrouter)
* and
* [API](https://cloud.google.com/compute/docs/reference/latest/routers).
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const foobar = new gcp.compute.RouterInterface("foobar", {
* name: "interface-1",
* router: "router-1",
* region: "us-central1",
* ipRange: "169.254.1.1/30",
* vpnTunnel: "tunnel-1",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* foobar = gcp.compute.RouterInterface("foobar",
* name="interface-1",
* router="router-1",
* region="us-central1",
* ip_range="169.254.1.1/30",
* vpn_tunnel="tunnel-1")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var foobar = new Gcp.Compute.RouterInterface("foobar", new()
* {
* Name = "interface-1",
* Router = "router-1",
* Region = "us-central1",
* IpRange = "169.254.1.1/30",
* VpnTunnel = "tunnel-1",
* });
* });
* ```
* ```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.NewRouterInterface(ctx, "foobar", &compute.RouterInterfaceArgs{
* Name: pulumi.String("interface-1"),
* Router: pulumi.String("router-1"),
* Region: pulumi.String("us-central1"),
* IpRange: pulumi.String("169.254.1.1/30"),
* VpnTunnel: pulumi.String("tunnel-1"),
* })
* 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.RouterInterface;
* import com.pulumi.gcp.compute.RouterInterfaceArgs;
* 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 foobar = new RouterInterface("foobar", RouterInterfaceArgs.builder()
* .name("interface-1")
* .router("router-1")
* .region("us-central1")
* .ipRange("169.254.1.1/30")
* .vpnTunnel("tunnel-1")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* foobar:
* type: gcp:compute:RouterInterface
* properties:
* name: interface-1
* router: router-1
* region: us-central1
* ipRange: 169.254.1.1/30
* vpnTunnel: tunnel-1
* ```
*
* ## Import
* Router interfaces can be imported using the `project` (optional), `region`, `router`, and `name`, e.g.
* * `{{project_id}}/{{region}}/{{router}}/{{name}}`
* * `{{region}}/{{router}}/{{name}}`
* When using the `pulumi import` command, router interfaces can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:compute/routerInterface:RouterInterface default {{project_id}}/{{region}}/{{router}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/routerInterface:RouterInterface default {{region}}/{{router}}/{{name}}
* ```
*/
public class RouterInterface internal constructor(
override val javaResource: com.pulumi.gcp.compute.RouterInterface,
) : KotlinCustomResource(javaResource, RouterInterfaceMapper) {
/**
* The name or resource link to the
* VLAN interconnect for this interface. Changing this forces a new interface to
* be created. Only one of `vpn_tunnel`, `interconnect_attachment` or `subnetwork` can be specified.
*/
public val interconnectAttachment: Output?
get() = javaResource.interconnectAttachment().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* IP address and range of the interface. The IP range must be
* in the RFC3927 link-local IP space. Changing this forces a new interface to be created.
*/
public val ipRange: Output
get() = javaResource.ipRange().applyValue({ args0 -> args0 })
/**
* IP version of this interface. Can be either IPV4 or IPV6.
*/
public val ipVersion: Output
get() = javaResource.ipVersion().applyValue({ args0 -> args0 })
/**
* A unique name for the interface, required by GCE. Changing
* this forces a new interface to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The regional private internal IP address that is used
* to establish BGP sessions to a VM instance acting as a third-party Router Appliance. Changing this forces a new interface to be created.
*/
public val privateIpAddress: Output?
get() = javaResource.privateIpAddress().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ID of the project in which this interface's routerbelongs.
* If it is not provided, the provider project is used. Changing this forces a new interface to be created.
*/
public val project: Output
get() = javaResource.project().applyValue({ args0 -> args0 })
/**
* The name of the interface that is redundant to
* this interface. Changing this forces a new interface to be created.
*/
public val redundantInterface: Output
get() = javaResource.redundantInterface().applyValue({ args0 -> args0 })
/**
* The region this interface's router sits in.
* If not specified, the project region will be used. Changing this forces a new interface to be created.
*/
public val region: Output
get() = javaResource.region().applyValue({ args0 -> args0 })
/**
* The name of the router this interface will be attached to.
* Changing this forces a new interface to be created.
* In addition to the above required fields, a router interface must have specified either `ip_range` or exactly one of `vpn_tunnel`, `interconnect_attachment` or `subnetwork`, or both.
* - - -
*/
public val router: Output
get() = javaResource.router().applyValue({ args0 -> args0 })
/**
* The URI of the subnetwork resource that this interface
* belongs to, which must be in the same region as the Cloud Router. When you establish a BGP session to a VM instance using this interface, the VM instance must belong to the same subnetwork as the subnetwork specified here. Changing this forces a new interface to be created. Only one of `vpn_tunnel`, `interconnect_attachment` or `subnetwork` can be specified.
*/
public val subnetwork: Output?
get() = javaResource.subnetwork().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name or resource link to the VPN tunnel this
* interface will be linked to. Changing this forces a new interface to be created. Only
* one of `vpn_tunnel`, `interconnect_attachment` or `subnetwork` can be specified.
*/
public val vpnTunnel: Output?
get() = javaResource.vpnTunnel().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object RouterInterfaceMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.compute.RouterInterface::class == javaResource::class
override fun map(javaResource: Resource): RouterInterface = RouterInterface(
javaResource as
com.pulumi.gcp.compute.RouterInterface,
)
}
/**
* @see [RouterInterface].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [RouterInterface].
*/
public suspend fun routerInterface(
name: String,
block: suspend RouterInterfaceResourceBuilder.() -> Unit,
): RouterInterface {
val builder = RouterInterfaceResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [RouterInterface].
* @param name The _unique_ name of the resulting resource.
*/
public fun routerInterface(name: String): RouterInterface {
val builder = RouterInterfaceResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy