Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Yandex

v0.10.0 published on Thursday, Nov 18, 2021 by Pulumi

VpcRouteTable

Manages a route table within the Yandex.Cloud. For more information, see the official documentation.

Example Usage

using Pulumi;
using Yandex = Pulumi.Yandex;

class MyStack : Stack
{
    public MyStack()
    {
        var lab_net = new Yandex.VpcNetwork("lab-net", new Yandex.VpcNetworkArgs
        {
        });
        var lab_rt_a = new Yandex.VpcRouteTable("lab-rt-a", new Yandex.VpcRouteTableArgs
        {
            NetworkId = lab_net.Id,
            StaticRoutes = 
            {
                new Yandex.Inputs.VpcRouteTableStaticRouteArgs
                {
                    DestinationPrefix = "10.2.0.0/16",
                    NextHopAddress = "172.16.10.10",
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := yandex.NewVpcNetwork(ctx, "lab_net", nil)
		if err != nil {
			return err
		}
		_, err = yandex.NewVpcRouteTable(ctx, "lab_rt_a", &yandex.VpcRouteTableArgs{
			NetworkId: lab_net.ID(),
			StaticRoutes: VpcRouteTableStaticRouteArray{
				&VpcRouteTableStaticRouteArgs{
					DestinationPrefix: pulumi.String("10.2.0.0/16"),
					NextHopAddress:    pulumi.String("172.16.10.10"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_yandex as yandex

lab_net = yandex.VpcNetwork("lab-net")
lab_rt_a = yandex.VpcRouteTable("lab-rt-a",
    network_id=lab_net.id,
    static_routes=[yandex.VpcRouteTableStaticRouteArgs(
        destination_prefix="10.2.0.0/16",
        next_hop_address="172.16.10.10",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as yandex from "@pulumi/yandex";

const lab_net = new yandex.VpcNetwork("lab-net", {});
const lab_rt_a = new yandex.VpcRouteTable("lab-rt-a", {
    networkId: lab_net.id,
    staticRoutes: [{
        destinationPrefix: "10.2.0.0/16",
        nextHopAddress: "172.16.10.10",
    }],
});

Create a VpcRouteTable Resource

new VpcRouteTable(name: string, args: VpcRouteTableArgs, opts?: CustomResourceOptions);
@overload
def VpcRouteTable(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  description: Optional[str] = None,
                  folder_id: Optional[str] = None,
                  labels: Optional[Mapping[str, str]] = None,
                  name: Optional[str] = None,
                  network_id: Optional[str] = None,
                  static_routes: Optional[Sequence[VpcRouteTableStaticRouteArgs]] = None)
@overload
def VpcRouteTable(resource_name: str,
                  args: VpcRouteTableArgs,
                  opts: Optional[ResourceOptions] = None)
func NewVpcRouteTable(ctx *Context, name string, args VpcRouteTableArgs, opts ...ResourceOption) (*VpcRouteTable, error)
public VpcRouteTable(string name, VpcRouteTableArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args VpcRouteTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args VpcRouteTableArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VpcRouteTableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VpcRouteTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

VpcRouteTable Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The VpcRouteTable resource accepts the following input properties:

NetworkId string
ID of the network this route table belongs to.
Description string
An optional description of the route table. Provide this property when you create the resource.
FolderId string
The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
Labels Dictionary<string, string>
Labels to assign to this route table. A list of key/value pairs.
Name string
Name of the route table. Provided by the client when the route table is created.
StaticRoutes List<VpcRouteTableStaticRouteArgs>
A list of static route records for the route table. The structure is documented below.
NetworkId string
ID of the network this route table belongs to.
Description string
An optional description of the route table. Provide this property when you create the resource.
FolderId string
The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
Labels map[string]string
Labels to assign to this route table. A list of key/value pairs.
Name string
Name of the route table. Provided by the client when the route table is created.
StaticRoutes []VpcRouteTableStaticRouteArgs
A list of static route records for the route table. The structure is documented below.
networkId string
ID of the network this route table belongs to.
description string
An optional description of the route table. Provide this property when you create the resource.
folderId string
The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
labels {[key: string]: string}
Labels to assign to this route table. A list of key/value pairs.
name string
Name of the route table. Provided by the client when the route table is created.
staticRoutes VpcRouteTableStaticRouteArgs[]
A list of static route records for the route table. The structure is documented below.
network_id str
ID of the network this route table belongs to.
description str
An optional description of the route table. Provide this property when you create the resource.
folder_id str
The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
labels Mapping[str, str]
Labels to assign to this route table. A list of key/value pairs.
name str
Name of the route table. Provided by the client when the route table is created.
static_routes Sequence[VpcRouteTableStaticRouteArgs]
A list of static route records for the route table. The structure is documented below.

Outputs

All input properties are implicitly available as output properties. Additionally, the VpcRouteTable resource produces the following output properties:

CreatedAt string
Creation timestamp of the route table.
Id string
The provider-assigned unique ID for this managed resource.
CreatedAt string
Creation timestamp of the route table.
Id string
The provider-assigned unique ID for this managed resource.
createdAt string
Creation timestamp of the route table.
id string
The provider-assigned unique ID for this managed resource.
created_at str
Creation timestamp of the route table.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing VpcRouteTable Resource

Get an existing VpcRouteTable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VpcRouteTableState, opts?: CustomResourceOptions): VpcRouteTable
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        description: Optional[str] = None,
        folder_id: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        network_id: Optional[str] = None,
        static_routes: Optional[Sequence[VpcRouteTableStaticRouteArgs]] = None) -> VpcRouteTable
func GetVpcRouteTable(ctx *Context, name string, id IDInput, state *VpcRouteTableState, opts ...ResourceOption) (*VpcRouteTable, error)
public static VpcRouteTable Get(string name, Input<string> id, VpcRouteTableState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

CreatedAt string
Creation timestamp of the route table.
Description string
An optional description of the route table. Provide this property when you create the resource.
FolderId string
The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
Labels Dictionary<string, string>
Labels to assign to this route table. A list of key/value pairs.
Name string
Name of the route table. Provided by the client when the route table is created.
NetworkId string
ID of the network this route table belongs to.
StaticRoutes List<VpcRouteTableStaticRouteArgs>
A list of static route records for the route table. The structure is documented below.
CreatedAt string
Creation timestamp of the route table.
Description string
An optional description of the route table. Provide this property when you create the resource.
FolderId string
The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
Labels map[string]string
Labels to assign to this route table. A list of key/value pairs.
Name string
Name of the route table. Provided by the client when the route table is created.
NetworkId string
ID of the network this route table belongs to.
StaticRoutes []VpcRouteTableStaticRouteArgs
A list of static route records for the route table. The structure is documented below.
createdAt string
Creation timestamp of the route table.
description string
An optional description of the route table. Provide this property when you create the resource.
folderId string
The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
labels {[key: string]: string}
Labels to assign to this route table. A list of key/value pairs.
name string
Name of the route table. Provided by the client when the route table is created.
networkId string
ID of the network this route table belongs to.
staticRoutes VpcRouteTableStaticRouteArgs[]
A list of static route records for the route table. The structure is documented below.
created_at str
Creation timestamp of the route table.
description str
An optional description of the route table. Provide this property when you create the resource.
folder_id str
The ID of the folder to which the resource belongs. If omitted, the provider folder is used.
labels Mapping[str, str]
Labels to assign to this route table. A list of key/value pairs.
name str
Name of the route table. Provided by the client when the route table is created.
network_id str
ID of the network this route table belongs to.
static_routes Sequence[VpcRouteTableStaticRouteArgs]
A list of static route records for the route table. The structure is documented below.

Supporting Types

VpcRouteTableStaticRoute

DestinationPrefix string
Route prefix in CIDR notation.
NextHopAddress string
Address of the next hop.
DestinationPrefix string
Route prefix in CIDR notation.
NextHopAddress string
Address of the next hop.
destinationPrefix string
Route prefix in CIDR notation.
nextHopAddress string
Address of the next hop.
destination_prefix str
Route prefix in CIDR notation.
next_hop_address str
Address of the next hop.

Import

A route table can be imported using the id of the resource, e.g.

 $ pulumi import yandex:index/vpcRouteTable:VpcRouteTable default route_table_id

Package Details

Repository
https://github.com/pulumi/pulumi-yandex
License
Apache-2.0
Notes
This Pulumi package is based on the yandex Terraform Provider.