Class RouterRoute


  • public class RouterRoute
    extends com.pulumi.resources.CustomResource
    Creates a routing entry on a OpenStack V2 router. ## Example Usage ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.openstack.networking.Router; import com.pulumi.openstack.networking.RouterArgs; import com.pulumi.openstack.networking.Network; import com.pulumi.openstack.networking.NetworkArgs; import com.pulumi.openstack.networking.Subnet; import com.pulumi.openstack.networking.SubnetArgs; import com.pulumi.openstack.networking.RouterInterface; import com.pulumi.openstack.networking.RouterInterfaceArgs; import com.pulumi.openstack.networking.RouterRoute; import com.pulumi.openstack.networking.RouterRouteArgs; 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 Router("router1", RouterArgs.builder() .adminStateUp("true") .build()); var network1 = new Network("network1", NetworkArgs.builder() .adminStateUp("true") .build()); var subnet1 = new Subnet("subnet1", SubnetArgs.builder() .networkId(network1.id()) .cidr("192.168.199.0/24") .ipVersion(4) .build()); var int1 = new RouterInterface("int1", RouterInterfaceArgs.builder() .routerId(router1.id()) .subnetId(subnet1.id()) .build()); var routerRoute1 = new RouterRoute("routerRoute1", RouterRouteArgs.builder() .routerId(router1.id()) .destinationCidr("10.0.1.0/24") .nextHop("192.168.199.254") .build(), CustomResourceOptions.builder() .dependsOn("openstack_networking_router_interface_v2.int_1") .build()); } } ``` ## Notes The `next_hop` IP address must be directly reachable from the router at the ``openstack.networking.RouterRoute`` resource creation time. You can ensure that by explicitly specifying a dependency on the ``openstack.networking.RouterInterface`` resource that connects the next hop to the router, as in the example above. ## Import Routing entries can be imported using a combined ID using the following format`<router_id>-route-<destination_cidr>-<next_hop>` ```sh $ pulumi import openstack:networking/routerRoute:RouterRoute router_route_1 686fe248-386c-4f70-9f6c-281607dad079-route-10.0.1.0/24-192.168.199.25 ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> destinationCidr()  
      static RouterRoute get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, RouterRouteState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> nextHop()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.lang.String> routerId()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RouterRoute

        public RouterRoute​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • RouterRoute

        public RouterRoute​(java.lang.String name,
                           RouterRouteArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • RouterRoute

        public RouterRoute​(java.lang.String name,
                           RouterRouteArgs args,
                           @Nullable
                           com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • destinationCidr

        public com.pulumi.core.Output<java.lang.String> destinationCidr()
        Returns:
        CIDR block to match on the packet’s destination IP. Changing this creates a new routing entry.
      • nextHop

        public com.pulumi.core.Output<java.lang.String> nextHop()
        Returns:
        IP address of the next hop gateway. Changing this creates a new routing entry.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        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

        public com.pulumi.core.Output<java.lang.String> routerId()
        Returns:
        ID of the router this routing entry belongs to. Changing this creates a new routing entry.
      • get

        public static RouterRoute get​(java.lang.String name,
                                      com.pulumi.core.Output<java.lang.String> id,
                                      @Nullable
                                      RouterRouteState state,
                                      @Nullable
                                      com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.