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

def InterfaceAttach(resource_name, opts=None, fixed_ip=None, instance_id=None, network_id=None, port_id=None, region=None, __props__=None);
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:

InstanceId string

The ID of the Instance to attach the Port or Network to.

FixedIp 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.

NetworkId string

The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and port_id are mutually exclusive.

PortId string

The ID of the Port to attach to an Instance. NOTE: This option and network_id are mutually exclusive.

Region string

The region in which to create the interface attachment. If omitted, the region argument of the provider is used. Changing this creates a new attachment.

InstanceId string

The ID of the Instance to attach the Port or Network to.

FixedIp 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.

NetworkId string

The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and port_id are mutually exclusive.

PortId string

The ID of the Port to attach to an Instance. NOTE: This option and network_id are mutually exclusive.

Region string

The region in which to create the interface attachment. If omitted, the region argument of the provider is used. Changing this creates a new attachment.

instanceId string

The ID of the Instance to attach the Port or Network to.

fixedIp 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.

networkId string

The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and port_id are mutually exclusive.

portId string

The ID of the Port to attach to an Instance. NOTE: This option and network_id are mutually exclusive.

region string

The region in which to create the interface attachment. If omitted, the region argument 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_id are mutually exclusive.

port_id str

The ID of the Port to attach to an Instance. NOTE: This option and network_id are mutually exclusive.

region str

The region in which to create the interface attachment. If omitted, the region argument 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:

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.

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): InterfaceAttach
static 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:

FixedIp 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.

InstanceId string

The ID of the Instance to attach the Port or Network to.

NetworkId string

The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and port_id are mutually exclusive.

PortId string

The ID of the Port to attach to an Instance. NOTE: This option and network_id are mutually exclusive.

Region string

The region in which to create the interface attachment. If omitted, the region argument of the provider is used. Changing this creates a new attachment.

FixedIp 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.

InstanceId string

The ID of the Instance to attach the Port or Network to.

NetworkId string

The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and port_id are mutually exclusive.

PortId string

The ID of the Port to attach to an Instance. NOTE: This option and network_id are mutually exclusive.

Region string

The region in which to create the interface attachment. If omitted, the region argument of the provider is used. Changing this creates a new attachment.

fixedIp 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.

instanceId string

The ID of the Instance to attach the Port or Network to.

networkId string

The ID of the Network to attach to an Instance. A port will be created automatically. NOTE: This option and port_id are mutually exclusive.

portId string

The ID of the Port to attach to an Instance. NOTE: This option and network_id are mutually exclusive.

region string

The region in which to create the interface attachment. If omitted, the region argument 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_id are mutually exclusive.

port_id str

The ID of the Port to attach to an Instance. NOTE: This option and network_id are mutually exclusive.

region str

The region in which to create the interface attachment. If omitted, the region argument 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 openstack Terraform Provider.