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
{
DeviceIndex = 0,
InstanceId = aws_instance.Test.Id,
NetworkInterfaceId = aws_network_interface.Test.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewNetworkInterfaceAttachment(ctx, "test", &ec2.NetworkInterfaceAttachmentArgs{
DeviceIndex: pulumi.Int(0),
InstanceId: pulumi.String(aws_instance.Test.Id),
NetworkInterfaceId: pulumi.String(aws_network_interface.Test.Id),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
test = aws.ec2.NetworkInterfaceAttachment("test",
device_index=0,
instance_id=aws_instance["test"]["id"],
network_interface_id=aws_network_interface["test"]["id"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.ec2.NetworkInterfaceAttachment("test", {
deviceIndex: 0,
instanceId: aws_instance_test.id,
networkInterfaceId: aws_network_interface_test.id,
});Create a NetworkInterfaceAttachment Resource
new NetworkInterfaceAttachment(name: string, args: NetworkInterfaceAttachmentArgs, opts?: CustomResourceOptions);def NetworkInterfaceAttachment(resource_name, opts=None, device_index=None, instance_id=None, network_interface_id=None, __props__=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.
- 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 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:
- Device
Index int Network interface index (int).
- Instance
Id string Instance ID to attach.
- Network
Interface stringId ENI ID to attach.
- Device
Index int Network interface index (int).
- Instance
Id string Instance ID to attach.
- Network
Interface stringId ENI ID to attach.
- device
Index number Network interface index (int).
- instance
Id string Instance ID to attach.
- network
Interface stringId ENI ID to attach.
- device_
index float Network interface index (int).
- instance_
id str Instance ID to attach.
- network_
interface_ strid ENI ID to attach.
Outputs
All input properties are implicitly available as output properties. Additionally, the NetworkInterfaceAttachment resource produces the following output properties:
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): NetworkInterfaceAttachmentstatic get(resource_name, id, opts=None, attachment_id=None, device_index=None, instance_id=None, network_interface_id=None, status=None, __props__=None);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:
- Attachment
Id string The ENI Attachment ID.
- Device
Index int Network interface index (int).
- Instance
Id string Instance ID to attach.
- Network
Interface stringId ENI ID to attach.
- Status string
The status of the Network Interface Attachment.
- Attachment
Id string The ENI Attachment ID.
- Device
Index int Network interface index (int).
- Instance
Id string Instance ID to attach.
- Network
Interface stringId ENI ID to attach.
- Status string
The status of the Network Interface Attachment.
- attachment
Id string The ENI Attachment ID.
- device
Index number Network interface index (int).
- instance
Id string Instance ID to attach.
- network
Interface stringId ENI ID to attach.
- status string
The status of the Network Interface Attachment.
- attachment_
id str The ENI Attachment ID.
- device_
index float Network interface index (int).
- instance_
id str Instance ID to attach.
- network_
interface_ strid 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
awsTerraform Provider.