Module Members



Create a reference to an externally managed NetworkInterface.

Example usage:

eni: EC2.NetworkInterface.external("eni-1234abcd", AWS.Us-east-1)

Type Signature

 fun (String, Region) -> NetworkInterface
Argument: networkInterfaceId

The ID of the target NetworkInterface. Must be of the form “eni-” followed by 8 characters from a-z and 0-9.

Type: String

Argument: region

The Region containing the target NetworkInterface.

Type: Region


A reference to the specified NetworkInterface.

Type: NetworkInterface



new NetworkInterface (Constructor)

Call this constructor to create a new Fugue.AWS.EC2.NetworkInterface value.

Type Signature

 fun { subnet: Subnet,
       description: Optional<String>,
       privateIpAddress: Optional<String>,
       sourceDestCheck: Optional<Bool>,
       privateIpAddresses: Optional<List<String>>,
       tags: Optional<List<Tag>>,
       securityGroups: Optional<List<SecurityGroup>>,
       numSecondaryPrivateIpAddresses: Optional<Int>,
       elasticIPs: Optional<List<ElasticIpAttachment>>,
       resourceId: Optional<String> } -> NetworkInterface
Argument: subnet

The EC2 Subnet the Network Interface should associate with.

Type: Subnet

Argument: description

A plaintext description for the network interface. Mutable.

Type: Optional<String>

Argument: privateIpAddress

The primary private IPv4 address of the network interface. If no IP address is specified, AWS will select one at random from the subnet’s IPv4 CIDR range.

Type: Optional<String>

Argument: sourceDestCheck

Defaults to True. When set to False disables the source/destination checking. Disabling checking allows the NetworkInterface to forward traffic that it is not the source or destination of, allowing the NetworkInterface to work with a NAT (network address translation) instance. Mutable.

Type: Optional<Bool>

Argument: privateIpAddresses

A list of secondary private IPv4 addresses. Mutable.

Type: Optional<List<String>>

Argument: tags

A list of EC2 tags. Mutable.

Type: Optional<List<Tag>>

Argument: securityGroups

A list of EC2 Security Groups to associate with this network interface. Mutable.

Type: Optional<List<SecurityGroup>>

Argument: numSecondaryPrivateIpAddresses

The total number of secondary private IPv4 addresses to assign to this network interface. This is the number of randomly selected addresses plus the number of addresses specified in privateIpAddresses. The random addresses are chosen from the subnet’s CIDR block. If not specified, this will default to the total number of addresses in privateIpAddresses. Mutable.

Type: Optional<Int>

Argument: elasticIPs

A list of EC2 ElasticIpAttachments describing associations between private IPs associated with this network interface and EC2 ElasticIPs. Mutable.

Type: Optional<List<ElasticIpAttachment>>

Argument: resourceId

Resource ID of the resource to import with Fugue Import. This field is only honored on fugue run. The resource ID is the AWS ID. Mutable. Example: eni-1234abcd

Type: Optional<String>


A Fugue.Core.AWS.EC2.NetworkInterface value.

Type: NetworkInterface



Retrieve the region from a NetworkInterface value.

Works for NetworkInterfaces defined in the composition as well external values.

Example usage:

vpc: EC2.Vpc.new {
  region: AWS.Us-west-2,
  cidrBlock: "",

subnet: EC2.Subnet.new {
  vpc: vpc,
  cidrBlock: "",

networkInterface1: EC2.NetworkInterface.new {
  subnet: subnet,
region1: EC2.NetworkInterface.region(networkInterface1) # => AWS.Us-west-2

networkInterface2: EC2.NetworkInterface.external("eni-01234567", AWS.Us-east-1)
region2: EC2.NetworkInterface.region(networkInterface2) # => AWS.Us-east-1

Type Signature

 fun (NetworkInterface) -> Region
Argument: networkInterface

The network interface from which to get the region.

Type: NetworkInterface


The region containing the network interface.

Type: Region