yandex.VpcRouteTable
Explore with Pulumi AI
Manages a route table within the Yandex.Cloud. For more information, see the official documentation.
- How-to Guides
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
	})
}
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",
    }],
});
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",
    )])
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 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.
- name String
- The unique name of the resource.
- args 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",
        },
    },
});
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"),
		},
	},
})
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());
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",
    }])
const vpcRouteTableResource = new yandex.VpcRouteTable("vpcRouteTableResource", {
    networkId: "string",
    description: "string",
    folderId: "string",
    labels: {
        string: "string",
    },
    name: "string",
    staticRoutes: [{
        destinationPrefix: "string",
        nextHopAddress: "string",
    }],
});
type: yandex:VpcRouteTable
properties:
    description: string
    folderId: string
    labels:
        string: string
    name: string
    networkId: string
    staticRoutes:
        - destinationPrefix: string
          nextHopAddress: string
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 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<VpcRoute Table Static Route> 
- 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 []VpcRoute Table Static Route Args 
- 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 List<VpcRoute Table Static Route> 
- 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 VpcRoute Table Static Route[] 
- 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[VpcRoute Table Static Route Args] 
- 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>
- 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:
- created_at str
- Creation timestamp of the route table.
- id str
- 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) -> VpcRouteTablefunc 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
- 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.
- 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.
- 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<VpcRoute Table Static Route> 
- 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 []VpcRoute Table Static Route Args 
- 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<VpcRoute Table Static Route> 
- 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 VpcRoute Table Static Route[] 
- 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[VpcRoute Table Static Route Args] 
- 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.
- NextHop stringAddress 
- Address of the next hop.
- DestinationPrefix string
- Route prefix in CIDR notation.
- NextHop stringAddress 
- Address of the next hop.
- destinationPrefix String
- Route prefix in CIDR notation.
- nextHop StringAddress 
- Address of the next hop.
- destinationPrefix string
- Route prefix in CIDR notation.
- nextHop stringAddress 
- Address of the next hop.
- destination_prefix str
- Route prefix in CIDR notation.
- next_hop_ straddress 
- Address of the next hop.
- destinationPrefix String
- Route prefix in CIDR notation.
- nextHop StringAddress 
- 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
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 yandexTerraform Provider.