Try AWS Native preview for resources not in the classic version.
aws.ec2.NetworkInterface
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides an Elastic network interface (ENI) resource.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var test = new Aws.Ec2.NetworkInterface("test", new()
{
SubnetId = aws_subnet.Public_a.Id,
PrivateIps = new[]
{
"10.0.0.50",
},
SecurityGroups = new[]
{
aws_security_group.Web.Id,
},
Attachments = new[]
{
new Aws.Ec2.Inputs.NetworkInterfaceAttachmentArgs
{
Instance = aws_instance.Test.Id,
DeviceIndex = 1,
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewNetworkInterface(ctx, "test", &ec2.NetworkInterfaceArgs{
SubnetId: pulumi.Any(aws_subnet.Public_a.Id),
PrivateIps: pulumi.StringArray{
pulumi.String("10.0.0.50"),
},
SecurityGroups: pulumi.StringArray{
aws_security_group.Web.Id,
},
Attachments: ec2.NetworkInterfaceAttachmentTypeArray{
&ec2.NetworkInterfaceAttachmentTypeArgs{
Instance: pulumi.Any(aws_instance.Test.Id),
DeviceIndex: pulumi.Int(1),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ec2.NetworkInterface;
import com.pulumi.aws.ec2.NetworkInterfaceArgs;
import com.pulumi.aws.ec2.inputs.NetworkInterfaceAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new NetworkInterface("test", NetworkInterfaceArgs.builder()
.subnetId(aws_subnet.public_a().id())
.privateIps("10.0.0.50")
.securityGroups(aws_security_group.web().id())
.attachments(NetworkInterfaceAttachmentArgs.builder()
.instance(aws_instance.test().id())
.deviceIndex(1)
.build())
.build());
}
}
import pulumi
import pulumi_aws as aws
test = aws.ec2.NetworkInterface("test",
subnet_id=aws_subnet["public_a"]["id"],
private_ips=["10.0.0.50"],
security_groups=[aws_security_group["web"]["id"]],
attachments=[aws.ec2.NetworkInterfaceAttachmentArgs(
instance=aws_instance["test"]["id"],
device_index=1,
)])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.ec2.NetworkInterface("test", {
subnetId: aws_subnet.public_a.id,
privateIps: ["10.0.0.50"],
securityGroups: [aws_security_group.web.id],
attachments: [{
instance: aws_instance.test.id,
deviceIndex: 1,
}],
});
resources:
test:
type: aws:ec2:NetworkInterface
properties:
subnetId: ${aws_subnet.public_a.id}
privateIps:
- 10.0.0.50
securityGroups:
- ${aws_security_group.web.id}
attachments:
- instance: ${aws_instance.test.id}
deviceIndex: 1
Create NetworkInterface Resource
new NetworkInterface(name: string, args: NetworkInterfaceArgs, opts?: CustomResourceOptions);
@overload
def NetworkInterface(resource_name: str,
opts: Optional[ResourceOptions] = None,
attachments: Optional[Sequence[NetworkInterfaceAttachmentArgs]] = None,
description: Optional[str] = None,
interface_type: Optional[str] = None,
ipv4_prefix_count: Optional[int] = None,
ipv4_prefixes: Optional[Sequence[str]] = None,
ipv6_address_count: Optional[int] = None,
ipv6_address_list_enabled: Optional[bool] = None,
ipv6_address_lists: Optional[Sequence[str]] = None,
ipv6_addresses: Optional[Sequence[str]] = None,
ipv6_prefix_count: Optional[int] = None,
ipv6_prefixes: Optional[Sequence[str]] = None,
private_ip: Optional[str] = None,
private_ip_list_enabled: Optional[bool] = None,
private_ip_lists: Optional[Sequence[str]] = None,
private_ips: Optional[Sequence[str]] = None,
private_ips_count: Optional[int] = None,
security_groups: Optional[Sequence[str]] = None,
source_dest_check: Optional[bool] = None,
subnet_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None)
@overload
def NetworkInterface(resource_name: str,
args: NetworkInterfaceArgs,
opts: Optional[ResourceOptions] = None)
func NewNetworkInterface(ctx *Context, name string, args NetworkInterfaceArgs, opts ...ResourceOption) (*NetworkInterface, error)
public NetworkInterface(string name, NetworkInterfaceArgs args, CustomResourceOptions? opts = null)
public NetworkInterface(String name, NetworkInterfaceArgs args)
public NetworkInterface(String name, NetworkInterfaceArgs args, CustomResourceOptions options)
type: aws:ec2:NetworkInterface
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkInterfaceArgs
- 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 NetworkInterfaceArgs
- 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 NetworkInterfaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NetworkInterfaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NetworkInterfaceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
NetworkInterface Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The NetworkInterface resource accepts the following input properties:
- Subnet
Id string Subnet ID to create the ENI in.
The following arguments are optional:
- Attachments
List<Network
Interface Attachment> Configuration block to define the attachment of the ENI. See Attachment below for more details!
- Description string
Description for the network interface.
- Interface
Type string Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- Ipv4Prefix
Count int Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- Ipv4Prefixes List<string>
One or more IPv4 prefixes assigned to the network interface.
- Ipv6Address
Count int Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- Ipv6Address
List boolEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- Ipv6Address
Lists List<string> List of private IPs to assign to the ENI in sequential order.
- Ipv6Addresses List<string>
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- Ipv6Prefix
Count int Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- Ipv6Prefixes List<string>
One or more IPv6 prefixes assigned to the network interface.
- Private
Ip string - Private
Ip boolList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- Private
Ip List<string>Lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- Private
Ips List<string> List of private IPs to assign to the ENI without regard to order.
- Private
Ips intCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- Security
Groups List<string> List of security group IDs to assign to the ENI.
- Source
Dest boolCheck Whether to enable source destination checking for the ENI. Default true.
- Dictionary<string, string>
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- Subnet
Id string Subnet ID to create the ENI in.
The following arguments are optional:
- Attachments
[]Network
Interface Attachment Type Args Configuration block to define the attachment of the ENI. See Attachment below for more details!
- Description string
Description for the network interface.
- Interface
Type string Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- Ipv4Prefix
Count int Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- Ipv4Prefixes []string
One or more IPv4 prefixes assigned to the network interface.
- Ipv6Address
Count int Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- Ipv6Address
List boolEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- Ipv6Address
Lists []string List of private IPs to assign to the ENI in sequential order.
- Ipv6Addresses []string
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- Ipv6Prefix
Count int Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- Ipv6Prefixes []string
One or more IPv6 prefixes assigned to the network interface.
- Private
Ip string - Private
Ip boolList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- Private
Ip []stringLists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- Private
Ips []string List of private IPs to assign to the ENI without regard to order.
- Private
Ips intCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- Security
Groups []string List of security group IDs to assign to the ENI.
- Source
Dest boolCheck Whether to enable source destination checking for the ENI. Default true.
- map[string]string
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- subnet
Id String Subnet ID to create the ENI in.
The following arguments are optional:
- attachments
List<Network
Interface Attachment> Configuration block to define the attachment of the ENI. See Attachment below for more details!
- description String
Description for the network interface.
- interface
Type String Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- ipv4Prefix
Count Integer Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- ipv4Prefixes List<String>
One or more IPv4 prefixes assigned to the network interface.
- ipv6Address
Count Integer Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- ipv6Address
List BooleanEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- ipv6Address
Lists List<String> List of private IPs to assign to the ENI in sequential order.
- ipv6Addresses List<String>
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- ipv6Prefix
Count Integer Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- ipv6Prefixes List<String>
One or more IPv6 prefixes assigned to the network interface.
- private
Ip String - private
Ip BooleanList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- private
Ip List<String>Lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- private
Ips List<String> List of private IPs to assign to the ENI without regard to order.
- private
Ips IntegerCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- security
Groups List<String> List of security group IDs to assign to the ENI.
- source
Dest BooleanCheck Whether to enable source destination checking for the ENI. Default true.
- Map<String,String>
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- subnet
Id string Subnet ID to create the ENI in.
The following arguments are optional:
- attachments
Network
Interface Attachment[] Configuration block to define the attachment of the ENI. See Attachment below for more details!
- description string
Description for the network interface.
- interface
Type string Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- ipv4Prefix
Count number Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- ipv4Prefixes string[]
One or more IPv4 prefixes assigned to the network interface.
- ipv6Address
Count number Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- ipv6Address
List booleanEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- ipv6Address
Lists string[] List of private IPs to assign to the ENI in sequential order.
- ipv6Addresses string[]
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- ipv6Prefix
Count number Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- ipv6Prefixes string[]
One or more IPv6 prefixes assigned to the network interface.
- private
Ip string - private
Ip booleanList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- private
Ip string[]Lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- private
Ips string[] List of private IPs to assign to the ENI without regard to order.
- private
Ips numberCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- security
Groups string[] List of security group IDs to assign to the ENI.
- source
Dest booleanCheck Whether to enable source destination checking for the ENI. Default true.
- {[key: string]: string}
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- subnet_
id str Subnet ID to create the ENI in.
The following arguments are optional:
- attachments
Sequence[Network
Interface Attachment Args] Configuration block to define the attachment of the ENI. See Attachment below for more details!
- description str
Description for the network interface.
- interface_
type str Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- ipv4_
prefix_ intcount Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- ipv4_
prefixes Sequence[str] One or more IPv4 prefixes assigned to the network interface.
- ipv6_
address_ intcount Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- ipv6_
address_ boollist_ enabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- ipv6_
address_ Sequence[str]lists List of private IPs to assign to the ENI in sequential order.
- ipv6_
addresses Sequence[str] One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- ipv6_
prefix_ intcount Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- ipv6_
prefixes Sequence[str] One or more IPv6 prefixes assigned to the network interface.
- private_
ip str - private_
ip_ boollist_ enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- private_
ip_ Sequence[str]lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- private_
ips Sequence[str] List of private IPs to assign to the ENI without regard to order.
- private_
ips_ intcount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- security_
groups Sequence[str] List of security group IDs to assign to the ENI.
- source_
dest_ boolcheck Whether to enable source destination checking for the ENI. Default true.
- Mapping[str, str]
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
- subnet
Id String Subnet ID to create the ENI in.
The following arguments are optional:
- attachments List<Property Map>
Configuration block to define the attachment of the ENI. See Attachment below for more details!
- description String
Description for the network interface.
- interface
Type String Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- ipv4Prefix
Count Number Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- ipv4Prefixes List<String>
One or more IPv4 prefixes assigned to the network interface.
- ipv6Address
Count Number Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- ipv6Address
List BooleanEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- ipv6Address
Lists List<String> List of private IPs to assign to the ENI in sequential order.
- ipv6Addresses List<String>
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- ipv6Prefix
Count Number Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- ipv6Prefixes List<String>
One or more IPv6 prefixes assigned to the network interface.
- private
Ip String - private
Ip BooleanList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- private
Ip List<String>Lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- private
Ips List<String> List of private IPs to assign to the ENI without regard to order.
- private
Ips NumberCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- security
Groups List<String> List of security group IDs to assign to the ENI.
- source
Dest BooleanCheck Whether to enable source destination checking for the ENI. Default true.
- Map<String>
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Outputs
All input properties are implicitly available as output properties. Additionally, the NetworkInterface resource produces the following output properties:
- Arn string
ARN of the network interface.
- Id string
The provider-assigned unique ID for this managed resource.
- Mac
Address string MAC address of the network interface.
- Outpost
Arn string - Owner
Id string AWS account ID of the owner of the network interface.
- Private
Dns stringName Private DNS name of the network interface (IPv4).
- Dictionary<string, string>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- Arn string
ARN of the network interface.
- Id string
The provider-assigned unique ID for this managed resource.
- Mac
Address string MAC address of the network interface.
- Outpost
Arn string - Owner
Id string AWS account ID of the owner of the network interface.
- Private
Dns stringName Private DNS name of the network interface (IPv4).
- map[string]string
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
ARN of the network interface.
- id String
The provider-assigned unique ID for this managed resource.
- mac
Address String MAC address of the network interface.
- outpost
Arn String - owner
Id String AWS account ID of the owner of the network interface.
- private
Dns StringName Private DNS name of the network interface (IPv4).
- Map<String,String>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn string
ARN of the network interface.
- id string
The provider-assigned unique ID for this managed resource.
- mac
Address string MAC address of the network interface.
- outpost
Arn string - owner
Id string AWS account ID of the owner of the network interface.
- private
Dns stringName Private DNS name of the network interface (IPv4).
- {[key: string]: string}
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn str
ARN of the network interface.
- id str
The provider-assigned unique ID for this managed resource.
- mac_
address str MAC address of the network interface.
- outpost_
arn str - owner_
id str AWS account ID of the owner of the network interface.
- private_
dns_ strname Private DNS name of the network interface (IPv4).
- Mapping[str, str]
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
ARN of the network interface.
- id String
The provider-assigned unique ID for this managed resource.
- mac
Address String MAC address of the network interface.
- outpost
Arn String - owner
Id String AWS account ID of the owner of the network interface.
- private
Dns StringName Private DNS name of the network interface (IPv4).
- Map<String>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
Look up Existing NetworkInterface Resource
Get an existing NetworkInterface 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?: NetworkInterfaceState, opts?: CustomResourceOptions): NetworkInterface
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
arn: Optional[str] = None,
attachments: Optional[Sequence[NetworkInterfaceAttachmentArgs]] = None,
description: Optional[str] = None,
interface_type: Optional[str] = None,
ipv4_prefix_count: Optional[int] = None,
ipv4_prefixes: Optional[Sequence[str]] = None,
ipv6_address_count: Optional[int] = None,
ipv6_address_list_enabled: Optional[bool] = None,
ipv6_address_lists: Optional[Sequence[str]] = None,
ipv6_addresses: Optional[Sequence[str]] = None,
ipv6_prefix_count: Optional[int] = None,
ipv6_prefixes: Optional[Sequence[str]] = None,
mac_address: Optional[str] = None,
outpost_arn: Optional[str] = None,
owner_id: Optional[str] = None,
private_dns_name: Optional[str] = None,
private_ip: Optional[str] = None,
private_ip_list_enabled: Optional[bool] = None,
private_ip_lists: Optional[Sequence[str]] = None,
private_ips: Optional[Sequence[str]] = None,
private_ips_count: Optional[int] = None,
security_groups: Optional[Sequence[str]] = None,
source_dest_check: Optional[bool] = None,
subnet_id: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None) -> NetworkInterface
func GetNetworkInterface(ctx *Context, name string, id IDInput, state *NetworkInterfaceState, opts ...ResourceOption) (*NetworkInterface, error)
public static NetworkInterface Get(string name, Input<string> id, NetworkInterfaceState? state, CustomResourceOptions? opts = null)
public static NetworkInterface get(String name, Output<String> id, NetworkInterfaceState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- 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.
- Arn string
ARN of the network interface.
- Attachments
List<Network
Interface Attachment> Configuration block to define the attachment of the ENI. See Attachment below for more details!
- Description string
Description for the network interface.
- Interface
Type string Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- Ipv4Prefix
Count int Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- Ipv4Prefixes List<string>
One or more IPv4 prefixes assigned to the network interface.
- Ipv6Address
Count int Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- Ipv6Address
List boolEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- Ipv6Address
Lists List<string> List of private IPs to assign to the ENI in sequential order.
- Ipv6Addresses List<string>
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- Ipv6Prefix
Count int Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- Ipv6Prefixes List<string>
One or more IPv6 prefixes assigned to the network interface.
- Mac
Address string MAC address of the network interface.
- Outpost
Arn string - Owner
Id string AWS account ID of the owner of the network interface.
- Private
Dns stringName Private DNS name of the network interface (IPv4).
- Private
Ip string - Private
Ip boolList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- Private
Ip List<string>Lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- Private
Ips List<string> List of private IPs to assign to the ENI without regard to order.
- Private
Ips intCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- Security
Groups List<string> List of security group IDs to assign to the ENI.
- Source
Dest boolCheck Whether to enable source destination checking for the ENI. Default true.
- Subnet
Id string Subnet ID to create the ENI in.
The following arguments are optional:
- Dictionary<string, string>
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Dictionary<string, string>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- Arn string
ARN of the network interface.
- Attachments
[]Network
Interface Attachment Type Args Configuration block to define the attachment of the ENI. See Attachment below for more details!
- Description string
Description for the network interface.
- Interface
Type string Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- Ipv4Prefix
Count int Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- Ipv4Prefixes []string
One or more IPv4 prefixes assigned to the network interface.
- Ipv6Address
Count int Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- Ipv6Address
List boolEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- Ipv6Address
Lists []string List of private IPs to assign to the ENI in sequential order.
- Ipv6Addresses []string
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- Ipv6Prefix
Count int Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- Ipv6Prefixes []string
One or more IPv6 prefixes assigned to the network interface.
- Mac
Address string MAC address of the network interface.
- Outpost
Arn string - Owner
Id string AWS account ID of the owner of the network interface.
- Private
Dns stringName Private DNS name of the network interface (IPv4).
- Private
Ip string - Private
Ip boolList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- Private
Ip []stringLists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- Private
Ips []string List of private IPs to assign to the ENI without regard to order.
- Private
Ips intCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- Security
Groups []string List of security group IDs to assign to the ENI.
- Source
Dest boolCheck Whether to enable source destination checking for the ENI. Default true.
- Subnet
Id string Subnet ID to create the ENI in.
The following arguments are optional:
- map[string]string
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- map[string]string
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
ARN of the network interface.
- attachments
List<Network
Interface Attachment> Configuration block to define the attachment of the ENI. See Attachment below for more details!
- description String
Description for the network interface.
- interface
Type String Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- ipv4Prefix
Count Integer Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- ipv4Prefixes List<String>
One or more IPv4 prefixes assigned to the network interface.
- ipv6Address
Count Integer Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- ipv6Address
List BooleanEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- ipv6Address
Lists List<String> List of private IPs to assign to the ENI in sequential order.
- ipv6Addresses List<String>
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- ipv6Prefix
Count Integer Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- ipv6Prefixes List<String>
One or more IPv6 prefixes assigned to the network interface.
- mac
Address String MAC address of the network interface.
- outpost
Arn String - owner
Id String AWS account ID of the owner of the network interface.
- private
Dns StringName Private DNS name of the network interface (IPv4).
- private
Ip String - private
Ip BooleanList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- private
Ip List<String>Lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- private
Ips List<String> List of private IPs to assign to the ENI without regard to order.
- private
Ips IntegerCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- security
Groups List<String> List of security group IDs to assign to the ENI.
- source
Dest BooleanCheck Whether to enable source destination checking for the ENI. Default true.
- subnet
Id String Subnet ID to create the ENI in.
The following arguments are optional:
- Map<String,String>
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String,String>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn string
ARN of the network interface.
- attachments
Network
Interface Attachment[] Configuration block to define the attachment of the ENI. See Attachment below for more details!
- description string
Description for the network interface.
- interface
Type string Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- ipv4Prefix
Count number Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- ipv4Prefixes string[]
One or more IPv4 prefixes assigned to the network interface.
- ipv6Address
Count number Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- ipv6Address
List booleanEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- ipv6Address
Lists string[] List of private IPs to assign to the ENI in sequential order.
- ipv6Addresses string[]
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- ipv6Prefix
Count number Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- ipv6Prefixes string[]
One or more IPv6 prefixes assigned to the network interface.
- mac
Address string MAC address of the network interface.
- outpost
Arn string - owner
Id string AWS account ID of the owner of the network interface.
- private
Dns stringName Private DNS name of the network interface (IPv4).
- private
Ip string - private
Ip booleanList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- private
Ip string[]Lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- private
Ips string[] List of private IPs to assign to the ENI without regard to order.
- private
Ips numberCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- security
Groups string[] List of security group IDs to assign to the ENI.
- source
Dest booleanCheck Whether to enable source destination checking for the ENI. Default true.
- subnet
Id string Subnet ID to create the ENI in.
The following arguments are optional:
- {[key: string]: string}
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- {[key: string]: string}
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn str
ARN of the network interface.
- attachments
Sequence[Network
Interface Attachment Args] Configuration block to define the attachment of the ENI. See Attachment below for more details!
- description str
Description for the network interface.
- interface_
type str Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- ipv4_
prefix_ intcount Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- ipv4_
prefixes Sequence[str] One or more IPv4 prefixes assigned to the network interface.
- ipv6_
address_ intcount Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- ipv6_
address_ boollist_ enabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- ipv6_
address_ Sequence[str]lists List of private IPs to assign to the ENI in sequential order.
- ipv6_
addresses Sequence[str] One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- ipv6_
prefix_ intcount Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- ipv6_
prefixes Sequence[str] One or more IPv6 prefixes assigned to the network interface.
- mac_
address str MAC address of the network interface.
- outpost_
arn str - owner_
id str AWS account ID of the owner of the network interface.
- private_
dns_ strname Private DNS name of the network interface (IPv4).
- private_
ip str - private_
ip_ boollist_ enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- private_
ip_ Sequence[str]lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- private_
ips Sequence[str] List of private IPs to assign to the ENI without regard to order.
- private_
ips_ intcount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- security_
groups Sequence[str] List of security group IDs to assign to the ENI.
- source_
dest_ boolcheck Whether to enable source destination checking for the ENI. Default true.
- subnet_
id str Subnet ID to create the ENI in.
The following arguments are optional:
- Mapping[str, str]
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Mapping[str, str]
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
- arn String
ARN of the network interface.
- attachments List<Property Map>
Configuration block to define the attachment of the ENI. See Attachment below for more details!
- description String
Description for the network interface.
- interface
Type String Type of network interface to create. Set to
efa
for Elastic Fabric Adapter. Changinginterface_type
will cause the resource to be destroyed and re-created.- ipv4Prefix
Count Number Number of IPv4 prefixes that AWS automatically assigns to the network interface.
- ipv4Prefixes List<String>
One or more IPv4 prefixes assigned to the network interface.
- ipv6Address
Count Number Number of IPv6 addresses to assign to a network interface. You can't use this option if specifying specific
ipv6_addresses
. If your subnet has the AssignIpv6AddressOnCreation attribute set totrue
, you can specify0
to override this setting.- ipv6Address
List BooleanEnabled Whether
ipv6_address_list
is allowed and controls the IPs to assign to the ENI andipv6_addresses
andipv6_address_count
become read-only. Default false.- ipv6Address
Lists List<String> List of private IPs to assign to the ENI in sequential order.
- ipv6Addresses List<String>
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet. Addresses are assigned without regard to order. You can't use this option if you're specifying
ipv6_address_count
.- ipv6Prefix
Count Number Number of IPv6 prefixes that AWS automatically assigns to the network interface.
- ipv6Prefixes List<String>
One or more IPv6 prefixes assigned to the network interface.
- mac
Address String MAC address of the network interface.
- outpost
Arn String - owner
Id String AWS account ID of the owner of the network interface.
- private
Dns StringName Private DNS name of the network interface (IPv4).
- private
Ip String - private
Ip BooleanList Enabled Whether
private_ip_list
is allowed and controls the IPs to assign to the ENI andprivate_ips
andprivate_ips_count
become read-only. Default false.- private
Ip List<String>Lists List of private IPs to assign to the ENI in sequential order. Requires setting
private_ip_list_enabled
totrue
.- private
Ips List<String> List of private IPs to assign to the ENI without regard to order.
- private
Ips NumberCount Number of secondary private IPs to assign to the ENI. The total number of private IPs will be 1 +
private_ips_count
, as a primary private IP will be assiged to an ENI by default.- security
Groups List<String> List of security group IDs to assign to the ENI.
- source
Dest BooleanCheck Whether to enable source destination checking for the ENI. Default true.
- subnet
Id String Subnet ID to create the ENI in.
The following arguments are optional:
- Map<String>
Map of tags to assign to the resource. If configured with a provider
default_tags
configuration block present, tags with matching keys will overwrite those defined at the provider-level.- Map<String>
Map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.Please use
tags
instead.
Supporting Types
NetworkInterfaceAttachment, NetworkInterfaceAttachmentArgs
- Device
Index int Integer to define the devices index.
- Instance string
ID of the instance to attach to.
- Attachment
Id string
- Device
Index int Integer to define the devices index.
- Instance string
ID of the instance to attach to.
- Attachment
Id string
- device
Index Integer Integer to define the devices index.
- instance String
ID of the instance to attach to.
- attachment
Id String
- device
Index number Integer to define the devices index.
- instance string
ID of the instance to attach to.
- attachment
Id string
- device_
index int Integer to define the devices index.
- instance str
ID of the instance to attach to.
- attachment_
id str
- device
Index Number Integer to define the devices index.
- instance String
ID of the instance to attach to.
- attachment
Id String
Import
In TODO v1.5.0 and later, use an import
block to import Network Interfaces using the id
. For exampleterraform import {
to = aws_network_interface.test
id = “eni-e5aa89a3” } Using TODO import
, import Network Interfaces using the id
. For exampleconsole % TODO import aws_network_interface.test eni-e5aa89a3
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.