1. Packages
  2. Yandex
  3. API Docs
  4. VpcRouteTable
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

yandex.VpcRouteTable

Explore with Pulumi AI

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",
                },
            },
        });
    }

}
Copy
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
	})
}
Copy

Coming soon!

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",
    }],
});
Copy
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",
    )])
Copy

Coming soon!

Create VpcRouteTable Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new VpcRouteTable(name: string, args: VpcRouteTableArgs, opts?: CustomResourceOptions);
@overload
def VpcRouteTable(resource_name: str,
                  args: VpcRouteTableArgs,
                  opts: Optional[ResourceOptions] = None)

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

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VpcRouteTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. VpcRouteTableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VpcRouteTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VpcRouteTableArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var vpcRouteTableResource = new Yandex.VpcRouteTable("vpcRouteTableResource", new()
{
    NetworkId = "string",
    Description = "string",
    FolderId = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    StaticRoutes = new[]
    {
        new Yandex.Inputs.VpcRouteTableStaticRouteArgs
        {
            DestinationPrefix = "string",
            NextHopAddress = "string",
        },
    },
});
Copy
example, err := yandex.NewVpcRouteTable(ctx, "vpcRouteTableResource", &yandex.VpcRouteTableArgs{
	NetworkId:   pulumi.String("string"),
	Description: pulumi.String("string"),
	FolderId:    pulumi.String("string"),
	Labels: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name: pulumi.String("string"),
	StaticRoutes: yandex.VpcRouteTableStaticRouteArray{
		&yandex.VpcRouteTableStaticRouteArgs{
			DestinationPrefix: pulumi.String("string"),
			NextHopAddress:    pulumi.String("string"),
		},
	},
})
Copy
var vpcRouteTableResource = new VpcRouteTable("vpcRouteTableResource", VpcRouteTableArgs.builder()
    .networkId("string")
    .description("string")
    .folderId("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .staticRoutes(VpcRouteTableStaticRouteArgs.builder()
        .destinationPrefix("string")
        .nextHopAddress("string")
        .build())
    .build());
Copy
vpc_route_table_resource = yandex.VpcRouteTable("vpcRouteTableResource",
    network_id="string",
    description="string",
    folder_id="string",
    labels={
        "string": "string",
    },
    name="string",
    static_routes=[{
        "destination_prefix": "string",
        "next_hop_address": "string",
    }])
Copy
const vpcRouteTableResource = new yandex.VpcRouteTable("vpcRouteTableResource", {
    networkId: "string",
    description: "string",
    folderId: "string",
    labels: {
        string: "string",
    },
    name: "string",
    staticRoutes: [{
        destinationPrefix: "string",
        nextHopAddress: "string",
    }],
});
Copy
type: yandex:VpcRouteTable
properties:
    description: string
    folderId: string
    labels:
        string: string
    name: string
    networkId: string
    staticRoutes:
        - destinationPrefix: string
          nextHopAddress: string
Copy

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The VpcRouteTable resource accepts the following input properties:

NetworkId This property is required. 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<VpcRouteTableStaticRoute>
A list of static route records for the route table. The structure is documented below.
NetworkId This property is required. 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 This property is required. 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 List<VpcRouteTableStaticRoute>
A list of static route records for the route table. The structure is documented below.
networkId This property is required. 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 VpcRouteTableStaticRoute[]
A list of static route records for the route table. The structure is documented below.
network_id This property is required. 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.
networkId This property is required. 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>
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<Property Map>
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.
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.
createdAt String
Creation timestamp of the route table.
id String
The provider-assigned unique ID for this managed resource.

Look up 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)
public static VpcRouteTable get(String name, Output<String> id, VpcRouteTableState state, CustomResourceOptions options)
resources:  _:    type: yandex:VpcRouteTable    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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<VpcRouteTableStaticRoute>
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 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 List<VpcRouteTableStaticRoute>
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 VpcRouteTableStaticRoute[]
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.
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>
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<Property Map>
A list of static route records for the route table. The structure is documented below.

Supporting Types

VpcRouteTableStaticRoute
, VpcRouteTableStaticRouteArgs

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.
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.
destinationPrefix String
Route prefix in CIDR notation.
nextHopAddress String
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
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Yandex pulumi/pulumi-yandex
License
Apache-2.0
Notes
This Pulumi package is based on the yandex Terraform Provider.