1. Packages
  2. Flexibleengine Provider
  3. API Docs
  4. NetworkingRouterRouteV2
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

flexibleengine.NetworkingRouterRouteV2

Explore with Pulumi AI

flexibleengine logo
flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud

    !> WARNING: It has been deprecated, use flexibleengine.VpcRoute instead.

    Creates a routing entry on a FlexibleEngine V2 router.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as flexibleengine from "@pulumi/flexibleengine";
    
    const router1 = new flexibleengine.NetworkingRouterV2("router1", {adminStateUp: true});
    const network1 = new flexibleengine.NetworkingNetworkV2("network1", {adminStateUp: "true"});
    const subnet1 = new flexibleengine.NetworkingSubnetV2("subnet1", {
        networkId: network1.networkingNetworkV2Id,
        cidr: "192.168.199.0/24",
        ipVersion: 4,
    });
    const int1 = new flexibleengine.NetworkingRouterInterfaceV2("int1", {
        routerId: router1.networkingRouterV2Id,
        subnetId: subnet1.networkingSubnetV2Id,
    });
    const routerRoute1 = new flexibleengine.NetworkingRouterRouteV2("routerRoute1", {
        routerId: router1.networkingRouterV2Id,
        destinationCidr: "10.0.1.0/24",
        nextHop: "192.168.199.254",
    }, {
        dependsOn: [int1],
    });
    
    import pulumi
    import pulumi_flexibleengine as flexibleengine
    
    router1 = flexibleengine.NetworkingRouterV2("router1", admin_state_up=True)
    network1 = flexibleengine.NetworkingNetworkV2("network1", admin_state_up="true")
    subnet1 = flexibleengine.NetworkingSubnetV2("subnet1",
        network_id=network1.networking_network_v2_id,
        cidr="192.168.199.0/24",
        ip_version=4)
    int1 = flexibleengine.NetworkingRouterInterfaceV2("int1",
        router_id=router1.networking_router_v2_id,
        subnet_id=subnet1.networking_subnet_v2_id)
    router_route1 = flexibleengine.NetworkingRouterRouteV2("routerRoute1",
        router_id=router1.networking_router_v2_id,
        destination_cidr="10.0.1.0/24",
        next_hop="192.168.199.254",
        opts = pulumi.ResourceOptions(depends_on=[int1]))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/flexibleengine/flexibleengine"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		router1, err := flexibleengine.NewNetworkingRouterV2(ctx, "router1", &flexibleengine.NetworkingRouterV2Args{
    			AdminStateUp: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		network1, err := flexibleengine.NewNetworkingNetworkV2(ctx, "network1", &flexibleengine.NetworkingNetworkV2Args{
    			AdminStateUp: pulumi.String("true"),
    		})
    		if err != nil {
    			return err
    		}
    		subnet1, err := flexibleengine.NewNetworkingSubnetV2(ctx, "subnet1", &flexibleengine.NetworkingSubnetV2Args{
    			NetworkId: network1.NetworkingNetworkV2Id,
    			Cidr:      pulumi.String("192.168.199.0/24"),
    			IpVersion: pulumi.Float64(4),
    		})
    		if err != nil {
    			return err
    		}
    		int1, err := flexibleengine.NewNetworkingRouterInterfaceV2(ctx, "int1", &flexibleengine.NetworkingRouterInterfaceV2Args{
    			RouterId: router1.NetworkingRouterV2Id,
    			SubnetId: subnet1.NetworkingSubnetV2Id,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = flexibleengine.NewNetworkingRouterRouteV2(ctx, "routerRoute1", &flexibleengine.NetworkingRouterRouteV2Args{
    			RouterId:        router1.NetworkingRouterV2Id,
    			DestinationCidr: pulumi.String("10.0.1.0/24"),
    			NextHop:         pulumi.String("192.168.199.254"),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			int1,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Flexibleengine = Pulumi.Flexibleengine;
    
    return await Deployment.RunAsync(() => 
    {
        var router1 = new Flexibleengine.NetworkingRouterV2("router1", new()
        {
            AdminStateUp = true,
        });
    
        var network1 = new Flexibleengine.NetworkingNetworkV2("network1", new()
        {
            AdminStateUp = "true",
        });
    
        var subnet1 = new Flexibleengine.NetworkingSubnetV2("subnet1", new()
        {
            NetworkId = network1.NetworkingNetworkV2Id,
            Cidr = "192.168.199.0/24",
            IpVersion = 4,
        });
    
        var int1 = new Flexibleengine.NetworkingRouterInterfaceV2("int1", new()
        {
            RouterId = router1.NetworkingRouterV2Id,
            SubnetId = subnet1.NetworkingSubnetV2Id,
        });
    
        var routerRoute1 = new Flexibleengine.NetworkingRouterRouteV2("routerRoute1", new()
        {
            RouterId = router1.NetworkingRouterV2Id,
            DestinationCidr = "10.0.1.0/24",
            NextHop = "192.168.199.254",
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                int1,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.flexibleengine.NetworkingRouterV2;
    import com.pulumi.flexibleengine.NetworkingRouterV2Args;
    import com.pulumi.flexibleengine.NetworkingNetworkV2;
    import com.pulumi.flexibleengine.NetworkingNetworkV2Args;
    import com.pulumi.flexibleengine.NetworkingSubnetV2;
    import com.pulumi.flexibleengine.NetworkingSubnetV2Args;
    import com.pulumi.flexibleengine.NetworkingRouterInterfaceV2;
    import com.pulumi.flexibleengine.NetworkingRouterInterfaceV2Args;
    import com.pulumi.flexibleengine.NetworkingRouterRouteV2;
    import com.pulumi.flexibleengine.NetworkingRouterRouteV2Args;
    import com.pulumi.resources.CustomResourceOptions;
    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 router1 = new NetworkingRouterV2("router1", NetworkingRouterV2Args.builder()
                .adminStateUp("true")
                .build());
    
            var network1 = new NetworkingNetworkV2("network1", NetworkingNetworkV2Args.builder()
                .adminStateUp("true")
                .build());
    
            var subnet1 = new NetworkingSubnetV2("subnet1", NetworkingSubnetV2Args.builder()
                .networkId(network1.networkingNetworkV2Id())
                .cidr("192.168.199.0/24")
                .ipVersion(4)
                .build());
    
            var int1 = new NetworkingRouterInterfaceV2("int1", NetworkingRouterInterfaceV2Args.builder()
                .routerId(router1.networkingRouterV2Id())
                .subnetId(subnet1.networkingSubnetV2Id())
                .build());
    
            var routerRoute1 = new NetworkingRouterRouteV2("routerRoute1", NetworkingRouterRouteV2Args.builder()
                .routerId(router1.networkingRouterV2Id())
                .destinationCidr("10.0.1.0/24")
                .nextHop("192.168.199.254")
                .build(), CustomResourceOptions.builder()
                    .dependsOn(int1)
                    .build());
    
        }
    }
    
    resources:
      router1:
        type: flexibleengine:NetworkingRouterV2
        properties:
          adminStateUp: 'true'
      network1:
        type: flexibleengine:NetworkingNetworkV2
        properties:
          adminStateUp: 'true'
      subnet1:
        type: flexibleengine:NetworkingSubnetV2
        properties:
          networkId: ${network1.networkingNetworkV2Id}
          cidr: 192.168.199.0/24
          ipVersion: 4
      int1:
        type: flexibleengine:NetworkingRouterInterfaceV2
        properties:
          routerId: ${router1.networkingRouterV2Id}
          subnetId: ${subnet1.networkingSubnetV2Id}
      routerRoute1:
        type: flexibleengine:NetworkingRouterRouteV2
        properties:
          routerId: ${router1.networkingRouterV2Id}
          destinationCidr: 10.0.1.0/24
          nextHop: 192.168.199.254
        options:
          dependsOn:
            - ${int1}
    

    Notes

    The next_hop IP address must be directly reachable from the router at the flexibleengine.NetworkingRouterRouteV2 resource creation time. You can ensure that by explicitly specifying a dependency on the flexibleengine.NetworkingRouterInterfaceV2 resource that connects the next hop to the router, as in the example above.

    Create NetworkingRouterRouteV2 Resource

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

    Constructor syntax

    new NetworkingRouterRouteV2(name: string, args: NetworkingRouterRouteV2Args, opts?: CustomResourceOptions);
    @overload
    def NetworkingRouterRouteV2(resource_name: str,
                                args: NetworkingRouterRouteV2Args,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def NetworkingRouterRouteV2(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                destination_cidr: Optional[str] = None,
                                next_hop: Optional[str] = None,
                                router_id: Optional[str] = None,
                                networking_router_route_v2_id: Optional[str] = None,
                                region: Optional[str] = None)
    func NewNetworkingRouterRouteV2(ctx *Context, name string, args NetworkingRouterRouteV2Args, opts ...ResourceOption) (*NetworkingRouterRouteV2, error)
    public NetworkingRouterRouteV2(string name, NetworkingRouterRouteV2Args args, CustomResourceOptions? opts = null)
    public NetworkingRouterRouteV2(String name, NetworkingRouterRouteV2Args args)
    public NetworkingRouterRouteV2(String name, NetworkingRouterRouteV2Args args, CustomResourceOptions options)
    
    type: flexibleengine:NetworkingRouterRouteV2
    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 NetworkingRouterRouteV2Args
    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 NetworkingRouterRouteV2Args
    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 NetworkingRouterRouteV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkingRouterRouteV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkingRouterRouteV2Args
    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 networkingRouterRouteV2Resource = new Flexibleengine.NetworkingRouterRouteV2("networkingRouterRouteV2Resource", new()
    {
        DestinationCidr = "string",
        NextHop = "string",
        RouterId = "string",
        NetworkingRouterRouteV2Id = "string",
        Region = "string",
    });
    
    example, err := flexibleengine.NewNetworkingRouterRouteV2(ctx, "networkingRouterRouteV2Resource", &flexibleengine.NetworkingRouterRouteV2Args{
    	DestinationCidr:           pulumi.String("string"),
    	NextHop:                   pulumi.String("string"),
    	RouterId:                  pulumi.String("string"),
    	NetworkingRouterRouteV2Id: pulumi.String("string"),
    	Region:                    pulumi.String("string"),
    })
    
    var networkingRouterRouteV2Resource = new NetworkingRouterRouteV2("networkingRouterRouteV2Resource", NetworkingRouterRouteV2Args.builder()
        .destinationCidr("string")
        .nextHop("string")
        .routerId("string")
        .networkingRouterRouteV2Id("string")
        .region("string")
        .build());
    
    networking_router_route_v2_resource = flexibleengine.NetworkingRouterRouteV2("networkingRouterRouteV2Resource",
        destination_cidr="string",
        next_hop="string",
        router_id="string",
        networking_router_route_v2_id="string",
        region="string")
    
    const networkingRouterRouteV2Resource = new flexibleengine.NetworkingRouterRouteV2("networkingRouterRouteV2Resource", {
        destinationCidr: "string",
        nextHop: "string",
        routerId: "string",
        networkingRouterRouteV2Id: "string",
        region: "string",
    });
    
    type: flexibleengine:NetworkingRouterRouteV2
    properties:
        destinationCidr: string
        networkingRouterRouteV2Id: string
        nextHop: string
        region: string
        routerId: string
    

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

    DestinationCidr string
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    NextHop string
    IP address of the next hop gateway. Changing this creates a new routing entry.
    RouterId string
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    NetworkingRouterRouteV2Id string
    Region string
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    DestinationCidr string
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    NextHop string
    IP address of the next hop gateway. Changing this creates a new routing entry.
    RouterId string
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    NetworkingRouterRouteV2Id string
    Region string
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    destinationCidr String
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    nextHop String
    IP address of the next hop gateway. Changing this creates a new routing entry.
    routerId String
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    networkingRouterRouteV2Id String
    region String
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    destinationCidr string
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    nextHop string
    IP address of the next hop gateway. Changing this creates a new routing entry.
    routerId string
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    networkingRouterRouteV2Id string
    region string
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    destination_cidr str
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    next_hop str
    IP address of the next hop gateway. Changing this creates a new routing entry.
    router_id str
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    networking_router_route_v2_id str
    region str
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    destinationCidr String
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    nextHop String
    IP address of the next hop gateway. Changing this creates a new routing entry.
    routerId String
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    networkingRouterRouteV2Id String
    region String
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing NetworkingRouterRouteV2 Resource

    Get an existing NetworkingRouterRouteV2 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?: NetworkingRouterRouteV2State, opts?: CustomResourceOptions): NetworkingRouterRouteV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            destination_cidr: Optional[str] = None,
            networking_router_route_v2_id: Optional[str] = None,
            next_hop: Optional[str] = None,
            region: Optional[str] = None,
            router_id: Optional[str] = None) -> NetworkingRouterRouteV2
    func GetNetworkingRouterRouteV2(ctx *Context, name string, id IDInput, state *NetworkingRouterRouteV2State, opts ...ResourceOption) (*NetworkingRouterRouteV2, error)
    public static NetworkingRouterRouteV2 Get(string name, Input<string> id, NetworkingRouterRouteV2State? state, CustomResourceOptions? opts = null)
    public static NetworkingRouterRouteV2 get(String name, Output<String> id, NetworkingRouterRouteV2State state, CustomResourceOptions options)
    resources:  _:    type: flexibleengine:NetworkingRouterRouteV2    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.
    The following state arguments are supported:
    DestinationCidr string
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    NetworkingRouterRouteV2Id string
    NextHop string
    IP address of the next hop gateway. Changing this creates a new routing entry.
    Region string
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    RouterId string
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    DestinationCidr string
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    NetworkingRouterRouteV2Id string
    NextHop string
    IP address of the next hop gateway. Changing this creates a new routing entry.
    Region string
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    RouterId string
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    destinationCidr String
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    networkingRouterRouteV2Id String
    nextHop String
    IP address of the next hop gateway. Changing this creates a new routing entry.
    region String
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    routerId String
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    destinationCidr string
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    networkingRouterRouteV2Id string
    nextHop string
    IP address of the next hop gateway. Changing this creates a new routing entry.
    region string
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    routerId string
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    destination_cidr str
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    networking_router_route_v2_id str
    next_hop str
    IP address of the next hop gateway. Changing this creates a new routing entry.
    region str
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    router_id str
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.
    destinationCidr String
    CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
    networkingRouterRouteV2Id String
    nextHop String
    IP address of the next hop gateway. Changing this creates a new routing entry.
    region String
    The region in which to obtain the V2 networking client. A networking client is needed to configure a routing entry on a router. If omitted, the region argument of the provider is used. Changing this creates a new routing entry.
    routerId String
    ID of the router this routing entry belongs to. Changing this creates a new routing entry.

    Package Details

    Repository
    flexibleengine flexibleenginecloud/terraform-provider-flexibleengine
    License
    Notes
    This Pulumi package is based on the flexibleengine Terraform Provider.
    flexibleengine logo
    flexibleengine 1.46.0 published on Monday, Apr 14, 2025 by flexibleenginecloud