1. Packages
  2. Outscale Provider
  3. API Docs
  4. MainRouteTableLink
outscale 1.1.0 published on Thursday, Apr 3, 2025 by outscale

outscale.MainRouteTableLink

Explore with Pulumi AI

Manages a main route table link.

Note: On Net creation, the OUTSCALE API always creates an initial main route table. The main_route_table_linkresource records the ID of the inital route table under the default_route_table_id attribute. The “Destroy” action for a main_route_table_link consists of resetting the original route table as the main route table for the Net. The additional route table must remain intact in order for the main_route_table_link destroy to work properly.

For more information on this resource, see the User Guide.
For more information on this resource actions, see the API documentation.

Example Usage

Required resources

import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const net01 = new outscale.Net("net01", {ipRange: "10.0.0.0/16"});
const subnet01 = new outscale.Subnet("subnet01", {
    netId: net01.netId,
    ipRange: "10.0.0.0/18",
});
const routeTable01 = new outscale.RouteTable("routeTable01", {netId: net01.netId});
Copy
import pulumi
import pulumi_outscale as outscale

net01 = outscale.Net("net01", ip_range="10.0.0.0/16")
subnet01 = outscale.Subnet("subnet01",
    net_id=net01.net_id,
    ip_range="10.0.0.0/18")
route_table01 = outscale.RouteTable("routeTable01", net_id=net01.net_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		net01, err := outscale.NewNet(ctx, "net01", &outscale.NetArgs{
			IpRange: pulumi.String("10.0.0.0/16"),
		})
		if err != nil {
			return err
		}
		_, err = outscale.NewSubnet(ctx, "subnet01", &outscale.SubnetArgs{
			NetId:   net01.NetId,
			IpRange: pulumi.String("10.0.0.0/18"),
		})
		if err != nil {
			return err
		}
		_, err = outscale.NewRouteTable(ctx, "routeTable01", &outscale.RouteTableArgs{
			NetId: net01.NetId,
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var net01 = new Outscale.Net("net01", new()
    {
        IpRange = "10.0.0.0/16",
    });

    var subnet01 = new Outscale.Subnet("subnet01", new()
    {
        NetId = net01.NetId,
        IpRange = "10.0.0.0/18",
    });

    var routeTable01 = new Outscale.RouteTable("routeTable01", new()
    {
        NetId = net01.NetId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.Net;
import com.pulumi.outscale.NetArgs;
import com.pulumi.outscale.Subnet;
import com.pulumi.outscale.SubnetArgs;
import com.pulumi.outscale.RouteTable;
import com.pulumi.outscale.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 net01 = new Net("net01", NetArgs.builder()
            .ipRange("10.0.0.0/16")
            .build());

        var subnet01 = new Subnet("subnet01", SubnetArgs.builder()
            .netId(net01.netId())
            .ipRange("10.0.0.0/18")
            .build());

        var routeTable01 = new RouteTable("routeTable01", RouteTableArgs.builder()
            .netId(net01.netId())
            .build());

    }
}
Copy
resources:
  net01:
    type: outscale:Net
    properties:
      ipRange: 10.0.0.0/16
  subnet01:
    type: outscale:Subnet
    properties:
      netId: ${net01.netId}
      ipRange: 10.0.0.0/18
  routeTable01:
    type: outscale:RouteTable
    properties:
      netId: ${net01.netId}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as outscale from "@pulumi/outscale";

const main = new outscale.MainRouteTableLink("main", {
    netId: outscale_net.net01.net_id,
    routeTableId: outscale_route_table.route_table01.route_table_id,
});
Copy
import pulumi
import pulumi_outscale as outscale

main = outscale.MainRouteTableLink("main",
    net_id=outscale_net["net01"]["net_id"],
    route_table_id=outscale_route_table["route_table01"]["route_table_id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/outscale/outscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := outscale.NewMainRouteTableLink(ctx, "main", &outscale.MainRouteTableLinkArgs{
			NetId:        pulumi.Any(outscale_net.Net01.Net_id),
			RouteTableId: pulumi.Any(outscale_route_table.Route_table01.Route_table_id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Outscale = Pulumi.Outscale;

return await Deployment.RunAsync(() => 
{
    var main = new Outscale.MainRouteTableLink("main", new()
    {
        NetId = outscale_net.Net01.Net_id,
        RouteTableId = outscale_route_table.Route_table01.Route_table_id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.outscale.MainRouteTableLink;
import com.pulumi.outscale.MainRouteTableLinkArgs;
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 main = new MainRouteTableLink("main", MainRouteTableLinkArgs.builder()
            .netId(outscale_net.net01().net_id())
            .routeTableId(outscale_route_table.route_table01().route_table_id())
            .build());

    }
}
Copy
resources:
  main:
    type: outscale:MainRouteTableLink
    properties:
      netId: ${outscale_net.net01.net_id}
      routeTableId: ${outscale_route_table.route_table01.route_table_id}
Copy

Create MainRouteTableLink Resource

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

Constructor syntax

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

@overload
def MainRouteTableLink(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       net_id: Optional[str] = None,
                       route_table_id: Optional[str] = None,
                       main_route_table_link_id: Optional[str] = None)
func NewMainRouteTableLink(ctx *Context, name string, args MainRouteTableLinkArgs, opts ...ResourceOption) (*MainRouteTableLink, error)
public MainRouteTableLink(string name, MainRouteTableLinkArgs args, CustomResourceOptions? opts = null)
public MainRouteTableLink(String name, MainRouteTableLinkArgs args)
public MainRouteTableLink(String name, MainRouteTableLinkArgs args, CustomResourceOptions options)
type: outscale:MainRouteTableLink
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. MainRouteTableLinkArgs
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. MainRouteTableLinkArgs
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. MainRouteTableLinkArgs
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. MainRouteTableLinkArgs
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. MainRouteTableLinkArgs
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 mainRouteTableLinkResource = new Outscale.MainRouteTableLink("mainRouteTableLinkResource", new()
{
    NetId = "string",
    RouteTableId = "string",
    MainRouteTableLinkId = "string",
});
Copy
example, err := outscale.NewMainRouteTableLink(ctx, "mainRouteTableLinkResource", &outscale.MainRouteTableLinkArgs{
NetId: pulumi.String("string"),
RouteTableId: pulumi.String("string"),
MainRouteTableLinkId: pulumi.String("string"),
})
Copy
var mainRouteTableLinkResource = new MainRouteTableLink("mainRouteTableLinkResource", MainRouteTableLinkArgs.builder()
    .netId("string")
    .routeTableId("string")
    .mainRouteTableLinkId("string")
    .build());
Copy
main_route_table_link_resource = outscale.MainRouteTableLink("mainRouteTableLinkResource",
    net_id="string",
    route_table_id="string",
    main_route_table_link_id="string")
Copy
const mainRouteTableLinkResource = new outscale.MainRouteTableLink("mainRouteTableLinkResource", {
    netId: "string",
    routeTableId: "string",
    mainRouteTableLinkId: "string",
});
Copy
type: outscale:MainRouteTableLink
properties:
    mainRouteTableLinkId: string
    netId: string
    routeTableId: string
Copy

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

NetId This property is required. string
The ID of the Net.
RouteTableId This property is required. string
The ID of the route table.
MainRouteTableLinkId string
NetId This property is required. string
The ID of the Net.
RouteTableId This property is required. string
The ID of the route table.
MainRouteTableLinkId string
netId This property is required. String
The ID of the Net.
routeTableId This property is required. String
The ID of the route table.
mainRouteTableLinkId String
netId This property is required. string
The ID of the Net.
routeTableId This property is required. string
The ID of the route table.
mainRouteTableLinkId string
net_id This property is required. str
The ID of the Net.
route_table_id This property is required. str
The ID of the route table.
main_route_table_link_id str
netId This property is required. String
The ID of the Net.
routeTableId This property is required. String
The ID of the route table.
mainRouteTableLinkId String

Outputs

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

DefaultRouteTableId string
The ID of the default route table.
Id string
The provider-assigned unique ID for this managed resource.
LinkRouteTableId string
The ID of the association between the route table and the Subnet.
Main bool
If true, the route table is the main one.
RequestId string
SubnetId string
DefaultRouteTableId string
The ID of the default route table.
Id string
The provider-assigned unique ID for this managed resource.
LinkRouteTableId string
The ID of the association between the route table and the Subnet.
Main bool
If true, the route table is the main one.
RequestId string
SubnetId string
defaultRouteTableId String
The ID of the default route table.
id String
The provider-assigned unique ID for this managed resource.
linkRouteTableId String
The ID of the association between the route table and the Subnet.
main Boolean
If true, the route table is the main one.
requestId String
subnetId String
defaultRouteTableId string
The ID of the default route table.
id string
The provider-assigned unique ID for this managed resource.
linkRouteTableId string
The ID of the association between the route table and the Subnet.
main boolean
If true, the route table is the main one.
requestId string
subnetId string
default_route_table_id str
The ID of the default route table.
id str
The provider-assigned unique ID for this managed resource.
link_route_table_id str
The ID of the association between the route table and the Subnet.
main bool
If true, the route table is the main one.
request_id str
subnet_id str
defaultRouteTableId String
The ID of the default route table.
id String
The provider-assigned unique ID for this managed resource.
linkRouteTableId String
The ID of the association between the route table and the Subnet.
main Boolean
If true, the route table is the main one.
requestId String
subnetId String

Look up Existing MainRouteTableLink Resource

Get an existing MainRouteTableLink 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?: MainRouteTableLinkState, opts?: CustomResourceOptions): MainRouteTableLink
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        default_route_table_id: Optional[str] = None,
        link_route_table_id: Optional[str] = None,
        main: Optional[bool] = None,
        main_route_table_link_id: Optional[str] = None,
        net_id: Optional[str] = None,
        request_id: Optional[str] = None,
        route_table_id: Optional[str] = None,
        subnet_id: Optional[str] = None) -> MainRouteTableLink
func GetMainRouteTableLink(ctx *Context, name string, id IDInput, state *MainRouteTableLinkState, opts ...ResourceOption) (*MainRouteTableLink, error)
public static MainRouteTableLink Get(string name, Input<string> id, MainRouteTableLinkState? state, CustomResourceOptions? opts = null)
public static MainRouteTableLink get(String name, Output<String> id, MainRouteTableLinkState state, CustomResourceOptions options)
resources:  _:    type: outscale:MainRouteTableLink    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:
DefaultRouteTableId string
The ID of the default route table.
LinkRouteTableId string
The ID of the association between the route table and the Subnet.
Main bool
If true, the route table is the main one.
MainRouteTableLinkId string
NetId string
The ID of the Net.
RequestId string
RouteTableId string
The ID of the route table.
SubnetId string
DefaultRouteTableId string
The ID of the default route table.
LinkRouteTableId string
The ID of the association between the route table and the Subnet.
Main bool
If true, the route table is the main one.
MainRouteTableLinkId string
NetId string
The ID of the Net.
RequestId string
RouteTableId string
The ID of the route table.
SubnetId string
defaultRouteTableId String
The ID of the default route table.
linkRouteTableId String
The ID of the association between the route table and the Subnet.
main Boolean
If true, the route table is the main one.
mainRouteTableLinkId String
netId String
The ID of the Net.
requestId String
routeTableId String
The ID of the route table.
subnetId String
defaultRouteTableId string
The ID of the default route table.
linkRouteTableId string
The ID of the association between the route table and the Subnet.
main boolean
If true, the route table is the main one.
mainRouteTableLinkId string
netId string
The ID of the Net.
requestId string
routeTableId string
The ID of the route table.
subnetId string
default_route_table_id str
The ID of the default route table.
link_route_table_id str
The ID of the association between the route table and the Subnet.
main bool
If true, the route table is the main one.
main_route_table_link_id str
net_id str
The ID of the Net.
request_id str
route_table_id str
The ID of the route table.
subnet_id str
defaultRouteTableId String
The ID of the default route table.
linkRouteTableId String
The ID of the association between the route table and the Subnet.
main Boolean
If true, the route table is the main one.
mainRouteTableLinkId String
netId String
The ID of the Net.
requestId String
routeTableId String
The ID of the route table.
subnetId String

Package Details

Repository
outscale outscale/terraform-provider-outscale
License
Notes
This Pulumi package is based on the outscale Terraform Provider.