NetworkInterfaceAttachment

Attach an Elastic network interface (ENI) resource with EC2 instance.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Aws.Ec2.NetworkInterfaceAttachment("test", new Aws.Ec2.NetworkInterfaceAttachmentArgs
        {
            InstanceId = aws_instance.Test.Id,
            NetworkInterfaceId = aws_network_interface.Test.Id,
            DeviceIndex = 0,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/ec2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ec2.NewNetworkInterfaceAttachment(ctx, "test", &ec2.NetworkInterfaceAttachmentArgs{
			InstanceId:         pulumi.Any(aws_instance.Test.Id),
			NetworkInterfaceId: pulumi.Any(aws_network_interface.Test.Id),
			DeviceIndex:        pulumi.Int(0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

test = aws.ec2.NetworkInterfaceAttachment("test",
    instance_id=aws_instance["test"]["id"],
    network_interface_id=aws_network_interface["test"]["id"],
    device_index=0)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.ec2.NetworkInterfaceAttachment("test", {
    instanceId: aws_instance.test.id,
    networkInterfaceId: aws_network_interface.test.id,
    deviceIndex: 0,
});

Create a NetworkInterfaceAttachment Resource

new NetworkInterfaceAttachment(name: string, args: NetworkInterfaceAttachmentArgs, opts?: CustomResourceOptions);
@overload
def NetworkInterfaceAttachment(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               device_index: Optional[int] = None,
                               instance_id: Optional[str] = None,
                               network_interface_id: Optional[str] = None)
@overload
def NetworkInterfaceAttachment(resource_name: str,
                               args: NetworkInterfaceAttachmentArgs,
                               opts: Optional[ResourceOptions] = None)
func NewNetworkInterfaceAttachment(ctx *Context, name string, args NetworkInterfaceAttachmentArgs, opts ...ResourceOption) (*NetworkInterfaceAttachment, error)
public NetworkInterfaceAttachment(string name, NetworkInterfaceAttachmentArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args NetworkInterfaceAttachmentArgs
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 NetworkInterfaceAttachmentArgs
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 NetworkInterfaceAttachmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NetworkInterfaceAttachmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

NetworkInterfaceAttachment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The NetworkInterfaceAttachment resource accepts the following input properties:

DeviceIndex int
Network interface index (int).
InstanceId string
Instance ID to attach.
NetworkInterfaceId string
ENI ID to attach.
DeviceIndex int
Network interface index (int).
InstanceId string
Instance ID to attach.
NetworkInterfaceId string
ENI ID to attach.
deviceIndex number
Network interface index (int).
instanceId string
Instance ID to attach.
networkInterfaceId string
ENI ID to attach.
device_index int
Network interface index (int).
instance_id str
Instance ID to attach.
network_interface_id str
ENI ID to attach.

Outputs

All input properties are implicitly available as output properties. Additionally, the NetworkInterfaceAttachment resource produces the following output properties:

AttachmentId string
The ENI Attachment ID.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the Network Interface Attachment.
AttachmentId string
The ENI Attachment ID.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the Network Interface Attachment.
attachmentId string
The ENI Attachment ID.
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the Network Interface Attachment.
attachment_id str
The ENI Attachment ID.
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the Network Interface Attachment.

Look up an Existing NetworkInterfaceAttachment Resource

Get an existing NetworkInterfaceAttachment 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?: NetworkInterfaceAttachmentState, opts?: CustomResourceOptions): NetworkInterfaceAttachment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        attachment_id: Optional[str] = None,
        device_index: Optional[int] = None,
        instance_id: Optional[str] = None,
        network_interface_id: Optional[str] = None,
        status: Optional[str] = None) -> NetworkInterfaceAttachment
func GetNetworkInterfaceAttachment(ctx *Context, name string, id IDInput, state *NetworkInterfaceAttachmentState, opts ...ResourceOption) (*NetworkInterfaceAttachment, error)
public static NetworkInterfaceAttachment Get(string name, Input<string> id, NetworkInterfaceAttachmentState? 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:

AttachmentId string
The ENI Attachment ID.
DeviceIndex int
Network interface index (int).
InstanceId string
Instance ID to attach.
NetworkInterfaceId string
ENI ID to attach.
Status string
The status of the Network Interface Attachment.
AttachmentId string
The ENI Attachment ID.
DeviceIndex int
Network interface index (int).
InstanceId string
Instance ID to attach.
NetworkInterfaceId string
ENI ID to attach.
Status string
The status of the Network Interface Attachment.
attachmentId string
The ENI Attachment ID.
deviceIndex number
Network interface index (int).
instanceId string
Instance ID to attach.
networkInterfaceId string
ENI ID to attach.
status string
The status of the Network Interface Attachment.
attachment_id str
The ENI Attachment ID.
device_index int
Network interface index (int).
instance_id str
Instance ID to attach.
network_interface_id str
ENI ID to attach.
status str
The status of the Network Interface Attachment.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.