alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.vpc.RouteTable

Import

The route table can be imported using the id, e.g.

 $ pulumi import alicloud:vpc/routeTable:RouteTable foo vtb-abc123456

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var fooNetwork = new AliCloud.Vpc.Network("fooNetwork", new()
    {
        CidrBlock = "172.16.0.0/12",
        VpcName = "vpc-example-name",
    });

    var fooRouteTable = new AliCloud.Vpc.RouteTable("fooRouteTable", new()
    {
        VpcId = fooNetwork.Id,
        RouteTableName = "route-table-example-name",
        Description = "route-table-example-description",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooNetwork, err := vpc.NewNetwork(ctx, "fooNetwork", &vpc.NetworkArgs{
			CidrBlock: pulumi.String("172.16.0.0/12"),
			VpcName:   pulumi.String("vpc-example-name"),
		})
		if err != nil {
			return err
		}
		_, err = vpc.NewRouteTable(ctx, "fooRouteTable", &vpc.RouteTableArgs{
			VpcId:          fooNetwork.ID(),
			RouteTableName: pulumi.String("route-table-example-name"),
			Description:    pulumi.String("route-table-example-description"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.RouteTable;
import com.pulumi.alicloud.vpc.RouteTableArgs;
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 fooNetwork = new Network("fooNetwork", NetworkArgs.builder()        
            .cidrBlock("172.16.0.0/12")
            .vpcName("vpc-example-name")
            .build());

        var fooRouteTable = new RouteTable("fooRouteTable", RouteTableArgs.builder()        
            .vpcId(fooNetwork.id())
            .routeTableName("route-table-example-name")
            .description("route-table-example-description")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

foo_network = alicloud.vpc.Network("fooNetwork",
    cidr_block="172.16.0.0/12",
    vpc_name="vpc-example-name")
foo_route_table = alicloud.vpc.RouteTable("fooRouteTable",
    vpc_id=foo_network.id,
    route_table_name="route-table-example-name",
    description="route-table-example-description")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const fooNetwork = new alicloud.vpc.Network("fooNetwork", {
    cidrBlock: "172.16.0.0/12",
    vpcName: "vpc-example-name",
});
const fooRouteTable = new alicloud.vpc.RouteTable("fooRouteTable", {
    vpcId: fooNetwork.id,
    routeTableName: "route-table-example-name",
    description: "route-table-example-description",
});
resources:
  fooNetwork:
    type: alicloud:vpc:Network
    properties:
      cidrBlock: 172.16.0.0/12
      vpcName: vpc-example-name
  fooRouteTable:
    type: alicloud:vpc:RouteTable
    properties:
      vpcId: ${fooNetwork.id}
      routeTableName: route-table-example-name
      description: route-table-example-description

Create RouteTable Resource

new RouteTable(name: string, args: RouteTableArgs, opts?: CustomResourceOptions);
@overload
def RouteTable(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               associate_type: Optional[str] = None,
               description: Optional[str] = None,
               name: Optional[str] = None,
               route_table_name: Optional[str] = None,
               tags: Optional[Mapping[str, Any]] = None,
               vpc_id: Optional[str] = None)
@overload
def RouteTable(resource_name: str,
               args: RouteTableArgs,
               opts: Optional[ResourceOptions] = None)
func NewRouteTable(ctx *Context, name string, args RouteTableArgs, opts ...ResourceOption) (*RouteTable, error)
public RouteTable(string name, RouteTableArgs args, CustomResourceOptions? opts = null)
public RouteTable(String name, RouteTableArgs args)
public RouteTable(String name, RouteTableArgs args, CustomResourceOptions options)
type: alicloud:vpc:RouteTable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args RouteTableArgs
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 RouteTableArgs
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 RouteTableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RouteTableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args RouteTableArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

RouteTable 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 RouteTable resource accepts the following input properties:

VpcId string

The vpc_id of the route table, the field can't be changed.

AssociateType string

The type of routing table created. Valid values are VSwitch and Gateway

Description string

The description of the route table instance.

Name string

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

RouteTableName string

The name of the route table.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

VpcId string

The vpc_id of the route table, the field can't be changed.

AssociateType string

The type of routing table created. Valid values are VSwitch and Gateway

Description string

The description of the route table instance.

Name string

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

RouteTableName string

The name of the route table.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

vpcId String

The vpc_id of the route table, the field can't be changed.

associateType String

The type of routing table created. Valid values are VSwitch and Gateway

description String

The description of the route table instance.

name String

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

routeTableName String

The name of the route table.

tags Map<String,Object>

A mapping of tags to assign to the resource.

vpcId string

The vpc_id of the route table, the field can't be changed.

associateType string

The type of routing table created. Valid values are VSwitch and Gateway

description string

The description of the route table instance.

name string

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

routeTableName string

The name of the route table.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

vpc_id str

The vpc_id of the route table, the field can't be changed.

associate_type str

The type of routing table created. Valid values are VSwitch and Gateway

description str

The description of the route table instance.

name str

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

route_table_name str

The name of the route table.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

vpcId String

The vpc_id of the route table, the field can't be changed.

associateType String

The type of routing table created. Valid values are VSwitch and Gateway

description String

The description of the route table instance.

name String

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

routeTableName String

The name of the route table.

tags Map<Any>

A mapping of tags to assign to the resource.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

Status string

(Available in v1.119.1+) The status of the route table.

Id string

The provider-assigned unique ID for this managed resource.

Status string

(Available in v1.119.1+) The status of the route table.

id String

The provider-assigned unique ID for this managed resource.

status String

(Available in v1.119.1+) The status of the route table.

id string

The provider-assigned unique ID for this managed resource.

status string

(Available in v1.119.1+) The status of the route table.

id str

The provider-assigned unique ID for this managed resource.

status str

(Available in v1.119.1+) The status of the route table.

id String

The provider-assigned unique ID for this managed resource.

status String

(Available in v1.119.1+) The status of the route table.

Look up Existing RouteTable Resource

Get an existing RouteTable 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?: RouteTableState, opts?: CustomResourceOptions): RouteTable
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        associate_type: Optional[str] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        route_table_name: Optional[str] = None,
        status: Optional[str] = None,
        tags: Optional[Mapping[str, Any]] = None,
        vpc_id: Optional[str] = None) -> RouteTable
func GetRouteTable(ctx *Context, name string, id IDInput, state *RouteTableState, opts ...ResourceOption) (*RouteTable, error)
public static RouteTable Get(string name, Input<string> id, RouteTableState? state, CustomResourceOptions? opts = null)
public static RouteTable get(String name, Output<String> id, RouteTableState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
The following state arguments are supported:
AssociateType string

The type of routing table created. Valid values are VSwitch and Gateway

Description string

The description of the route table instance.

Name string

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

RouteTableName string

The name of the route table.

Status string

(Available in v1.119.1+) The status of the route table.

Tags Dictionary<string, object>

A mapping of tags to assign to the resource.

VpcId string

The vpc_id of the route table, the field can't be changed.

AssociateType string

The type of routing table created. Valid values are VSwitch and Gateway

Description string

The description of the route table instance.

Name string

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

RouteTableName string

The name of the route table.

Status string

(Available in v1.119.1+) The status of the route table.

Tags map[string]interface{}

A mapping of tags to assign to the resource.

VpcId string

The vpc_id of the route table, the field can't be changed.

associateType String

The type of routing table created. Valid values are VSwitch and Gateway

description String

The description of the route table instance.

name String

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

routeTableName String

The name of the route table.

status String

(Available in v1.119.1+) The status of the route table.

tags Map<String,Object>

A mapping of tags to assign to the resource.

vpcId String

The vpc_id of the route table, the field can't be changed.

associateType string

The type of routing table created. Valid values are VSwitch and Gateway

description string

The description of the route table instance.

name string

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

routeTableName string

The name of the route table.

status string

(Available in v1.119.1+) The status of the route table.

tags {[key: string]: any}

A mapping of tags to assign to the resource.

vpcId string

The vpc_id of the route table, the field can't be changed.

associate_type str

The type of routing table created. Valid values are VSwitch and Gateway

description str

The description of the route table instance.

name str

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

route_table_name str

The name of the route table.

status str

(Available in v1.119.1+) The status of the route table.

tags Mapping[str, Any]

A mapping of tags to assign to the resource.

vpc_id str

The vpc_id of the route table, the field can't be changed.

associateType String

The type of routing table created. Valid values are VSwitch and Gateway

description String

The description of the route table instance.

name String

Field name has been deprecated from provider version 1.119.1. New field route_table_name instead.

Deprecated:

Field 'name' has been deprecated from provider version 1.119.1. New field 'route_table_name' instead.

routeTableName String

The name of the route table.

status String

(Available in v1.119.1+) The status of the route table.

tags Map<Any>

A mapping of tags to assign to the resource.

vpcId String

The vpc_id of the route table, the field can't be changed.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.