AWS Security ChangesHomeSearch

AWS AWSEC2 documentation change

Service: AWSEC2 · 2025-04-20 · Documentation low

File: AWSEC2/latest/UserGuide/create-network-interface.md

Summary

Added multiple CLI/PowerShell examples for creating network interfaces with specific IP configurations

Security assessment

Adds operational examples for network interface creation but does not address security vulnerabilities or document security features.

Diff

diff --git a/AWSEC2/latest/UserGuide/create-network-interface.md b/AWSEC2/latest/UserGuide/create-network-interface.md
index 50fb1ce47..04cc94b19 100644
--- a//AWSEC2/latest/UserGuide/create-network-interface.md
+++ b//AWSEC2/latest/UserGuide/create-network-interface.md
@@ -68 +68 @@ AWS CLI
-###### To create a network interface
+###### Example 1: To create a network interface with IP addresses chosen by Amazon EC2
@@ -70 +70 @@ AWS CLI
-Use the following [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command.
+Use the following [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command. This example creates a network interface with a public IPv4 address and an IPv6 address chosen by Amazon EC2.
@@ -78,0 +79,35 @@ Use the following [create-network-interface](https://awscli.amazonaws.com/v2/doc
+###### Example 2: To create a network interface with specific IP addresses
+
+Use the following [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command.
+    
+    
+    aws ec2 create-network-interface \
+        --subnet-id subnet-0e99b93155EXAMPLE \
+        --description "my dual-stack network interface" \
+        --private-ip-address 10.251.50.12 \
+        --ipv6-addresses 2001:db8::1234:5678:1.2.3.4 \
+        --groups sg-1234567890abcdef0
+
+###### Example 3: To create a network interface with a count of secondary IP addresses
+
+Use the following [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command. In this example, Amazon EC2 chooses both the primary IP address and the secondary IP addresses.
+    
+    
+    aws ec2 create-network-interface \
+        --subnet-id subnet-0e99b93155EXAMPLE \
+        --description "my network interface" \
+        --secondary-private-ip-address-count 2 \
+        --groups sg-1234567890abcdef0
+
+###### Example 4: To create a network interface with a specific secondary IP address
+
+Use the following [create-network-interface](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/create-network-interface.html) command. This example specifies a primary IP address and a secondary IP address.
+    
+    
+    aws ec2 create-network-interface \
+        --subnet-id subnet-0e99b93155EXAMPLE \
+        --description "my network interface" \
+        --private-ip-addresses PrivateIpAddress=10.0.1.30,Primary=true \
+                               PrivateIpAddress=10.0.1.31,Primary=false
+        --groups sg-1234567890abcdef0
+
@@ -82 +117 @@ PowerShell
-###### To create a network interface
+###### Example 1: To create a network interface with IP addresses chosen by Amazon EC2
@@ -84 +119 @@ PowerShell
-Use the following [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2NetworkInterface.html) cmdlet.
+Use the following [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2NetworkInterface.html) cmdlet. This example creates a network interface with a public IPv4 address and an IPv6 address chosen by Amazon EC2.
@@ -92,0 +128,50 @@ Use the following [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershe
+###### Example 2: To create a network interface with specific IP addresses
+
+Use the following [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2NetworkInterface.html) cmdlet.
+    
+    
+    New-EC2NetworkInterface `
+        -SubnetId subnet-0e99b93155EXAMPLE `
+        -Description "my dual-stack network interface" `
+        -PrivateIpAddress 10.251.50.12 `
+        -Ipv6Address $ipv6addr `
+        -Group sg-1234567890abcdef0
+
+Define the IPv6 addresses as follows.
+    
+    
+    $ipv6addr = New-Object Amazon.EC2.Model.InstanceIpv6Address
+    $ipv6addr1.Ipv6Address = "2001:db8::1234:5678:1.2.3.4"
+
+###### Example 3: To create a network interface with a count of secondary IP addresses
+
+Use the following [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2NetworkInterface.html) cmdlet. In this example, Amazon EC2 chooses both the primary IP address and the secondary IP addresses.
+    
+    
+    New-EC2NetworkInterface `
+        -SubnetId subnet-0e99b93155EXAMPLE `
+        -Description "my network interface" `
+        -SecondaryPrivateIpAddressCount 2 `
+        -Group sg-1234567890abcdef0
+
+###### Example 4: To create a network interface with a specific secondary IP address
+
+Use the following [New-EC2NetworkInterface](https://docs.aws.amazon.com/powershell/latest/reference/items/New-EC2NetworkInterface.html) cmdlet. This example specifies a primary IP address and a secondary IP address.
+    
+    
+    New-EC2NetworkInterface `
+        -SubnetId subnet-0e99b93155EXAMPLE `
+        -Description "my network interface" `
+        -PrivateIpAddresses @($primary, $secondary) `
+        -Group sg-1234567890abcdef0
+
+Define the secondary addresses as follows.
+    
+    
+    $primary = New-Object Amazon.EC2.Model.PrivateIpAddressSpecification
+    $primary.PrivateIpAddress = "10.0.1.30"
+    $primary.Primary = $true
+    $secondary = New-Object Amazon.EC2.Model.PrivateIpAddressSpecification
+    $secondary.PrivateIpAddress = "10.0.1.31"
+    $secondary.Primary = $false
+