InterfaceAttach
Attaches a Network Interface (a Port) to an Instance using the OpenStack Compute (Nova) v2 API.
Example Usage
Basic Attachment
using Pulumi;
using OpenStack = Pulumi.OpenStack;
class MyStack : Stack
{
public MyStack()
{
var network1 = new OpenStack.Networking.Network("network1", new OpenStack.Networking.NetworkArgs
{
AdminStateUp = true,
});
var instance1 = new OpenStack.Compute.Instance("instance1", new OpenStack.Compute.InstanceArgs
{
SecurityGroups =
{
"default",
},
});
var ai1 = new OpenStack.Compute.InterfaceAttach("ai1", new OpenStack.Compute.InterfaceAttachArgs
{
InstanceId = instance1.Id,
NetworkId = openstack_networking_port_v2.Network_1.Id,
});
}
}
Coming soon!
import pulumi
import pulumi_openstack as openstack
network1 = openstack.networking.Network("network1", admin_state_up="true")
instance1 = openstack.compute.Instance("instance1", security_groups=["default"])
ai1 = openstack.compute.InterfaceAttach("ai1",
instance_id=instance1.id,
network_id=openstack_networking_port_v2["network_1"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const network1 = new openstack.networking.Network("network_1", {
adminStateUp: true,
});
const instance1 = new openstack.compute.Instance("instance_1", {
securityGroups: ["default"],
});
const ai1 = new openstack.compute.InterfaceAttach("ai_1", {
instanceId: instance1.id,
networkId: openstack_networking_port_v2_network_1.id,
});Attachment Specifying a Fixed IP
using Pulumi;
using OpenStack = Pulumi.OpenStack;
class MyStack : Stack
{
public MyStack()
{
var network1 = new OpenStack.Networking.Network("network1", new OpenStack.Networking.NetworkArgs
{
AdminStateUp = true,
});
var instance1 = new OpenStack.Compute.Instance("instance1", new OpenStack.Compute.InstanceArgs
{
SecurityGroups =
{
"default",
},
});
var ai1 = new OpenStack.Compute.InterfaceAttach("ai1", new OpenStack.Compute.InterfaceAttachArgs
{
FixedIp = "10.0.10.10",
InstanceId = instance1.Id,
NetworkId = openstack_networking_port_v2.Network_1.Id,
});
}
}
Coming soon!
import pulumi
import pulumi_openstack as openstack
network1 = openstack.networking.Network("network1", admin_state_up="true")
instance1 = openstack.compute.Instance("instance1", security_groups=["default"])
ai1 = openstack.compute.InterfaceAttach("ai1",
fixed_ip="10.0.10.10",
instance_id=instance1.id,
network_id=openstack_networking_port_v2["network_1"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const network1 = new openstack.networking.Network("network_1", {
adminStateUp: true,
});
const instance1 = new openstack.compute.Instance("instance_1", {
securityGroups: ["default"],
});
const ai1 = new openstack.compute.InterfaceAttach("ai_1", {
fixedIp: "10.0.10.10",
instanceId: instance1.id,
networkId: openstack_networking_port_v2_network_1.id,
});Attachment Using an Existing Port
using Pulumi;
using OpenStack = Pulumi.OpenStack;
class MyStack : Stack
{
public MyStack()
{
var network1 = new OpenStack.Networking.Network("network1", new OpenStack.Networking.NetworkArgs
{
AdminStateUp = true,
});
var port1 = new OpenStack.Networking.Port("port1", new OpenStack.Networking.PortArgs
{
AdminStateUp = true,
NetworkId = network1.Id,
});
var instance1 = new OpenStack.Compute.Instance("instance1", new OpenStack.Compute.InstanceArgs
{
SecurityGroups =
{
"default",
},
});
var ai1 = new OpenStack.Compute.InterfaceAttach("ai1", new OpenStack.Compute.InterfaceAttachArgs
{
InstanceId = instance1.Id,
PortId = port1.Id,
});
}
}
Coming soon!
import pulumi
import pulumi_openstack as openstack
network1 = openstack.networking.Network("network1", admin_state_up="true")
port1 = openstack.networking.Port("port1",
admin_state_up="true",
network_id=network1.id)
instance1 = openstack.compute.Instance("instance1", security_groups=["default"])
ai1 = openstack.compute.InterfaceAttach("ai1",
instance_id=instance1.id,
port_id=port1.id)import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const network1 = new openstack.networking.Network("network_1", {
adminStateUp: true,
});
const port1 = new openstack.networking.Port("port_1", {
adminStateUp: true,
networkId: network1.id,
});
const instance1 = new openstack.compute.Instance("instance_1", {
securityGroups: ["default"],
});
const ai1 = new openstack.compute.InterfaceAttach("ai_1", {
instanceId: instance1.id,
portId: port1.id,
});Create a InterfaceAttach Resource
new InterfaceAttach(name: string, args: InterfaceAttachArgs, opts?: CustomResourceOptions);def InterfaceAttach(resource_name, opts=None, fixed_ip=None, instance_id=None, network_id=None, port_id=None, region=None, __props__=None);func NewInterfaceAttach(ctx *Context, name string, args InterfaceAttachArgs, opts ...ResourceOption) (*InterfaceAttach, error)public InterfaceAttach(string name, InterfaceAttachArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args InterfaceAttachArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args InterfaceAttachArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InterfaceAttachArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
InterfaceAttach Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The InterfaceAttach resource accepts the following input properties:
- Instance
Id string The ID of the Instance to attach the Port or Network to.
- Fixed
Ip string An IP address to assosciate with the port. NOTE: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
- Network
Id string The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and
port_idare mutually exclusive.- Port
Id string The ID of the Port to attach to an Instance. NOTE: This option and
network_idare mutually exclusive.- Region string
The region in which to create the interface attachment. If omitted, the
regionargument of the provider is used. Changing this creates a new attachment.
- Instance
Id string The ID of the Instance to attach the Port or Network to.
- Fixed
Ip string An IP address to assosciate with the port. NOTE: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
- Network
Id string The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and
port_idare mutually exclusive.- Port
Id string The ID of the Port to attach to an Instance. NOTE: This option and
network_idare mutually exclusive.- Region string
The region in which to create the interface attachment. If omitted, the
regionargument of the provider is used. Changing this creates a new attachment.
- instance
Id string The ID of the Instance to attach the Port or Network to.
- fixed
Ip string An IP address to assosciate with the port. NOTE: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
- network
Id string The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and
port_idare mutually exclusive.- port
Id string The ID of the Port to attach to an Instance. NOTE: This option and
network_idare mutually exclusive.- region string
The region in which to create the interface attachment. If omitted, the
regionargument of the provider is used. Changing this creates a new attachment.
- instance_
id str The ID of the Instance to attach the Port or Network to.
- fixed_
ip str An IP address to assosciate with the port. NOTE: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
- network_
id str The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and
port_idare mutually exclusive.- port_
id str The ID of the Port to attach to an Instance. NOTE: This option and
network_idare mutually exclusive.- region str
The region in which to create the interface attachment. If omitted, the
regionargument of the provider is used. Changing this creates a new attachment.
Outputs
All input properties are implicitly available as output properties. Additionally, the InterfaceAttach resource produces the following output properties:
Look up an Existing InterfaceAttach Resource
Get an existing InterfaceAttach 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?: InterfaceAttachState, opts?: CustomResourceOptions): InterfaceAttachstatic get(resource_name, id, opts=None, fixed_ip=None, instance_id=None, network_id=None, port_id=None, region=None, __props__=None);func GetInterfaceAttach(ctx *Context, name string, id IDInput, state *InterfaceAttachState, opts ...ResourceOption) (*InterfaceAttach, error)public static InterfaceAttach Get(string name, Input<string> id, InterfaceAttachState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Fixed
Ip string An IP address to assosciate with the port. NOTE: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
- Instance
Id string The ID of the Instance to attach the Port or Network to.
- Network
Id string The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and
port_idare mutually exclusive.- Port
Id string The ID of the Port to attach to an Instance. NOTE: This option and
network_idare mutually exclusive.- Region string
The region in which to create the interface attachment. If omitted, the
regionargument of the provider is used. Changing this creates a new attachment.
- Fixed
Ip string An IP address to assosciate with the port. NOTE: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
- Instance
Id string The ID of the Instance to attach the Port or Network to.
- Network
Id string The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and
port_idare mutually exclusive.- Port
Id string The ID of the Port to attach to an Instance. NOTE: This option and
network_idare mutually exclusive.- Region string
The region in which to create the interface attachment. If omitted, the
regionargument of the provider is used. Changing this creates a new attachment.
- fixed
Ip string An IP address to assosciate with the port. NOTE: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
- instance
Id string The ID of the Instance to attach the Port or Network to.
- network
Id string The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and
port_idare mutually exclusive.- port
Id string The ID of the Port to attach to an Instance. NOTE: This option and
network_idare mutually exclusive.- region string
The region in which to create the interface attachment. If omitted, the
regionargument of the provider is used. Changing this creates a new attachment.
- fixed_
ip str An IP address to assosciate with the port. NOTE: This option cannot be used with port_id. You must specifiy a network_id. The IP address must lie in a range on the supplied network.
- instance_
id str The ID of the Instance to attach the Port or Network to.
- network_
id str The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and
port_idare mutually exclusive.- port_
id str The ID of the Port to attach to an Instance. NOTE: This option and
network_idare mutually exclusive.- region str
The region in which to create the interface attachment. If omitted, the
regionargument of the provider is used. Changing this creates a new attachment.
Package Details
- Repository
- https://github.com/pulumi/pulumi-openstack
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
openstackTerraform Provider.