openstack.networking.RouterInterface
Manages a V2 router interface resource within OpenStack.
Example Usage
using System.Collections.Generic;
using Pulumi;
using OpenStack = Pulumi.OpenStack;
return await Deployment.RunAsync(() =>
{
var network1 = new OpenStack.Networking.Network("network1", new()
{
AdminStateUp = true,
});
var subnet1 = new OpenStack.Networking.Subnet("subnet1", new()
{
Cidr = "192.168.199.0/24",
IpVersion = 4,
NetworkId = network1.Id,
});
var router1 = new OpenStack.Networking.Router("router1", new()
{
ExternalNetworkId = "f67f0d72-0ddf-11e4-9d95-e1f29f417e2f",
});
var routerInterface1 = new OpenStack.Networking.RouterInterface("routerInterface1", new()
{
RouterId = router1.Id,
SubnetId = subnet1.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/networking"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
network1, err := networking.NewNetwork(ctx, "network1", &networking.NetworkArgs{
AdminStateUp: pulumi.Bool(true),
})
if err != nil {
return err
}
subnet1, err := networking.NewSubnet(ctx, "subnet1", &networking.SubnetArgs{
Cidr: pulumi.String("192.168.199.0/24"),
IpVersion: pulumi.Int(4),
NetworkId: network1.ID(),
})
if err != nil {
return err
}
router1, err := networking.NewRouter(ctx, "router1", &networking.RouterArgs{
ExternalNetworkId: pulumi.String("f67f0d72-0ddf-11e4-9d95-e1f29f417e2f"),
})
if err != nil {
return err
}
_, err = networking.NewRouterInterface(ctx, "routerInterface1", &networking.RouterInterfaceArgs{
RouterId: router1.ID(),
SubnetId: subnet1.ID(),
})
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.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.Router;
import com.pulumi.openstack.networking.RouterArgs;
import com.pulumi.openstack.networking.RouterInterface;
import com.pulumi.openstack.networking.RouterInterfaceArgs;
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 network1 = new Network("network1", NetworkArgs.builder()
.adminStateUp("true")
.build());
var subnet1 = new Subnet("subnet1", SubnetArgs.builder()
.cidr("192.168.199.0/24")
.ipVersion(4)
.networkId(network1.id())
.build());
var router1 = new Router("router1", RouterArgs.builder()
.externalNetworkId("f67f0d72-0ddf-11e4-9d95-e1f29f417e2f")
.build());
var routerInterface1 = new RouterInterface("routerInterface1", RouterInterfaceArgs.builder()
.routerId(router1.id())
.subnetId(subnet1.id())
.build());
}
}
import pulumi
import pulumi_openstack as openstack
network1 = openstack.networking.Network("network1", admin_state_up=True)
subnet1 = openstack.networking.Subnet("subnet1",
cidr="192.168.199.0/24",
ip_version=4,
network_id=network1.id)
router1 = openstack.networking.Router("router1", external_network_id="f67f0d72-0ddf-11e4-9d95-e1f29f417e2f")
router_interface1 = openstack.networking.RouterInterface("routerInterface1",
router_id=router1.id,
subnet_id=subnet1.id)
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const network1 = new openstack.networking.Network("network1", {adminStateUp: true});
const subnet1 = new openstack.networking.Subnet("subnet1", {
cidr: "192.168.199.0/24",
ipVersion: 4,
networkId: network1.id,
});
const router1 = new openstack.networking.Router("router1", {externalNetworkId: "f67f0d72-0ddf-11e4-9d95-e1f29f417e2f"});
const routerInterface1 = new openstack.networking.RouterInterface("routerInterface1", {
routerId: router1.id,
subnetId: subnet1.id,
});
resources:
network1:
type: openstack:networking:Network
properties:
adminStateUp: 'true'
subnet1:
type: openstack:networking:Subnet
properties:
cidr: 192.168.199.0/24
ipVersion: 4
networkId: ${network1.id}
router1:
type: openstack:networking:Router
properties:
externalNetworkId: f67f0d72-0ddf-11e4-9d95-e1f29f417e2f
routerInterface1:
type: openstack:networking:RouterInterface
properties:
routerId: ${router1.id}
subnetId: ${subnet1.id}
Create RouterInterface Resource
new RouterInterface(name: string, args: RouterInterfaceArgs, opts?: CustomResourceOptions);
@overload
def RouterInterface(resource_name: str,
opts: Optional[ResourceOptions] = None,
force_destroy: Optional[bool] = None,
port_id: Optional[str] = None,
region: Optional[str] = None,
router_id: Optional[str] = None,
subnet_id: Optional[str] = None)
@overload
def RouterInterface(resource_name: str,
args: RouterInterfaceArgs,
opts: Optional[ResourceOptions] = None)
func NewRouterInterface(ctx *Context, name string, args RouterInterfaceArgs, opts ...ResourceOption) (*RouterInterface, error)
public RouterInterface(string name, RouterInterfaceArgs args, CustomResourceOptions? opts = null)
public RouterInterface(String name, RouterInterfaceArgs args)
public RouterInterface(String name, RouterInterfaceArgs args, CustomResourceOptions options)
type: openstack:networking:RouterInterface
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouterInterfaceArgs
- 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 RouterInterfaceArgs
- 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 RouterInterfaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RouterInterfaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RouterInterfaceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RouterInterface 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 RouterInterface resource accepts the following input properties:
- Router
Id string ID of the router this interface belongs to. Changing this creates a new router interface.
- Force
Destroy bool A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- Port
Id string ID of the port this interface connects to. Changing this creates a new router interface.
- Region string
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- Subnet
Id string ID of the subnet this interface connects to. Changing this creates a new router interface.
- Router
Id string ID of the router this interface belongs to. Changing this creates a new router interface.
- Force
Destroy bool A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- Port
Id string ID of the port this interface connects to. Changing this creates a new router interface.
- Region string
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- Subnet
Id string ID of the subnet this interface connects to. Changing this creates a new router interface.
- router
Id String ID of the router this interface belongs to. Changing this creates a new router interface.
- force
Destroy Boolean A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- port
Id String ID of the port this interface connects to. Changing this creates a new router interface.
- region String
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- subnet
Id String ID of the subnet this interface connects to. Changing this creates a new router interface.
- router
Id string ID of the router this interface belongs to. Changing this creates a new router interface.
- force
Destroy boolean A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- port
Id string ID of the port this interface connects to. Changing this creates a new router interface.
- region string
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- subnet
Id string ID of the subnet this interface connects to. Changing this creates a new router interface.
- router_
id str ID of the router this interface belongs to. Changing this creates a new router interface.
- force_
destroy bool A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- port_
id str ID of the port this interface connects to. Changing this creates a new router interface.
- region str
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- subnet_
id str ID of the subnet this interface connects to. Changing this creates a new router interface.
- router
Id String ID of the router this interface belongs to. Changing this creates a new router interface.
- force
Destroy Boolean A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- port
Id String ID of the port this interface connects to. Changing this creates a new router interface.
- region String
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- subnet
Id String ID of the subnet this interface connects to. Changing this creates a new router interface.
Outputs
All input properties are implicitly available as output properties. Additionally, the RouterInterface 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 RouterInterface Resource
Get an existing RouterInterface 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?: RouterInterfaceState, opts?: CustomResourceOptions): RouterInterface
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
force_destroy: Optional[bool] = None,
port_id: Optional[str] = None,
region: Optional[str] = None,
router_id: Optional[str] = None,
subnet_id: Optional[str] = None) -> RouterInterface
func GetRouterInterface(ctx *Context, name string, id IDInput, state *RouterInterfaceState, opts ...ResourceOption) (*RouterInterface, error)
public static RouterInterface Get(string name, Input<string> id, RouterInterfaceState? state, CustomResourceOptions? opts = null)
public static RouterInterface get(String name, Output<String> id, RouterInterfaceState 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.
- Force
Destroy bool A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- Port
Id string ID of the port this interface connects to. Changing this creates a new router interface.
- Region string
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- Router
Id string ID of the router this interface belongs to. Changing this creates a new router interface.
- Subnet
Id string ID of the subnet this interface connects to. Changing this creates a new router interface.
- Force
Destroy bool A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- Port
Id string ID of the port this interface connects to. Changing this creates a new router interface.
- Region string
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- Router
Id string ID of the router this interface belongs to. Changing this creates a new router interface.
- Subnet
Id string ID of the subnet this interface connects to. Changing this creates a new router interface.
- force
Destroy Boolean A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- port
Id String ID of the port this interface connects to. Changing this creates a new router interface.
- region String
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- router
Id String ID of the router this interface belongs to. Changing this creates a new router interface.
- subnet
Id String ID of the subnet this interface connects to. Changing this creates a new router interface.
- force
Destroy boolean A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- port
Id string ID of the port this interface connects to. Changing this creates a new router interface.
- region string
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- router
Id string ID of the router this interface belongs to. Changing this creates a new router interface.
- subnet
Id string ID of the subnet this interface connects to. Changing this creates a new router interface.
- force_
destroy bool A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- port_
id str ID of the port this interface connects to. Changing this creates a new router interface.
- region str
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- router_
id str ID of the router this interface belongs to. Changing this creates a new router interface.
- subnet_
id str ID of the subnet this interface connects to. Changing this creates a new router interface.
- force
Destroy Boolean A boolean indicating whether the routes from the corresponding router ID should be deleted so that the router interface can be destroyed without any errors. The default value is
false
.- port
Id String ID of the port this interface connects to. Changing this creates a new router interface.
- region String
The region in which to obtain the V2 networking client. A networking client is needed to create a router. If omitted, the
region
argument of the provider is used. Changing this creates a new router interface.- router
Id String ID of the router this interface belongs to. Changing this creates a new router interface.
- subnet
Id String ID of the subnet this interface connects to. Changing this creates a new router interface.
Import
Router Interfaces can be imported using the port id
, e.g. $ openstack port list –router
$ pulumi import openstack:networking/routerInterface:RouterInterface int_1 <port id from above output>
Package Details
- Repository
- OpenStack pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
openstack
Terraform Provider.