Show / Hide Table of Contents

Class 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,
    });
}

}

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,
    });
}

}

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,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
InterfaceAttach
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.OpenStack.Compute
Assembly: Pulumi.OpenStack.dll
Syntax
public class InterfaceAttach : CustomResource

Constructors

View Source

InterfaceAttach(String, InterfaceAttachArgs, CustomResourceOptions)

Create a InterfaceAttach resource with the given unique name, arguments, and options.

Declaration
public InterfaceAttach(string name, InterfaceAttachArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

InterfaceAttachArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

FixedIp

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.

Declaration
public Output<string> FixedIp { get; }
Property Value
Type Description
Output<System.String>
View Source

InstanceId

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

Declaration
public Output<string> InstanceId { get; }
Property Value
Type Description
Output<System.String>
View Source

NetworkId

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.

Declaration
public Output<string> NetworkId { get; }
Property Value
Type Description
Output<System.String>
View Source

PortId

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

Declaration
public Output<string> PortId { get; }
Property Value
Type Description
Output<System.String>
View Source

Region

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.

Declaration
public Output<string> Region { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, InterfaceAttachState, CustomResourceOptions)

Get an existing InterfaceAttach resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static InterfaceAttach Get(string name, Input<string> id, InterfaceAttachState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

InterfaceAttachState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
InterfaceAttach
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.