AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
Container for the parameters to the ModifyNetworkInterfaceAttribute operation. Modifies the specified network interface attribute. You can specify only one attribute at a time. You can use this action to attach and detach security groups from an existing EC2 instance.
Namespace: Amazon.EC2.Model
Assembly: AWSSDK.EC2.dll
Version: 3.x.y.z
public class ModifyNetworkInterfaceAttributeRequest : AmazonEC2Request IAmazonWebServiceRequest
The ModifyNetworkInterfaceAttributeRequest type exposes the following members
Name | Description | |
---|---|---|
![]() |
ModifyNetworkInterfaceAttributeRequest() |
Name | Type | Description | |
---|---|---|---|
![]() |
AssociatePublicIpAddress | System.Boolean |
Gets and sets the property AssociatePublicIpAddress. Indicates whether to assign a public IPv4 address to a network interface. This option can be enabled for any network interface but will only apply to the primary network interface (eth0). |
![]() |
Attachment | Amazon.EC2.Model.NetworkInterfaceAttachmentChanges |
Gets and sets the property Attachment.
Information about the interface attachment. If modifying the |
![]() |
ConnectionTrackingSpecification | Amazon.EC2.Model.ConnectionTrackingSpecificationRequest |
Gets and sets the property ConnectionTrackingSpecification. A connection tracking specification. |
![]() |
Description | System.String |
Gets and sets the property Description. A description for the network interface. |
![]() |
EnablePrimaryIpv6 | System.Boolean |
Gets and sets the property EnablePrimaryIpv6. If you’re modifying a network interface in a dual-stack or IPv6-only subnet, you have the option to assign a primary IPv6 IP address. A primary IPv6 address is an IPv6 GUA address associated with an ENI that you have enabled to use a primary IPv6 address. Use this option if the instance that this ENI will be attached to relies on its IPv6 address not changing. Amazon Web Services will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you cannot disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address. |
![]() |
EnaSrdSpecification | Amazon.EC2.Model.EnaSrdSpecification |
Gets and sets the property EnaSrdSpecification. Updates the ENA Express configuration for the network interface that’s attached to the instance. |
![]() |
Groups | System.Collections.Generic.List<System.String> |
Gets and sets the property Groups. Changes the security groups for the network interface. The new set of groups you specify replaces the current set. You must specify at least one group, even if it's just the default security group in the VPC. You must specify the ID of the security group, not the name. |
![]() |
NetworkInterfaceId | System.String |
Gets and sets the property NetworkInterfaceId. The ID of the network interface. |
![]() |
SourceDestCheck | System.Boolean |
Gets and sets the property SourceDestCheck.
Enable or disable source/destination checks, which ensure that the instance is either
the source or the destination of any traffic that it receives. If the value is |
This example modifies the attachment attribute of the specified network interface.
var client = new AmazonEC2Client(); var response = client.ModifyNetworkInterfaceAttribute(new ModifyNetworkInterfaceAttributeRequest { Attachment = new NetworkInterfaceAttachmentChanges { AttachmentId = "eni-attach-43348162", DeleteOnTermination = false }, NetworkInterfaceId = "eni-686ea200" });
This example modifies the description attribute of the specified network interface.
var client = new AmazonEC2Client(); var response = client.ModifyNetworkInterfaceAttribute(new ModifyNetworkInterfaceAttributeRequest { Description = <data>, NetworkInterfaceId = "eni-686ea200" });
This example command modifies the groupSet attribute of the specified network interface.
var client = new AmazonEC2Client(); var response = client.ModifyNetworkInterfaceAttribute(new ModifyNetworkInterfaceAttributeRequest { Groups = new List<string> { "sg-903004f8", "sg-1a2b3c4d" }, NetworkInterfaceId = "eni-686ea200" });
This example command modifies the sourceDestCheck attribute of the specified network interface.
var client = new AmazonEC2Client(); var response = client.ModifyNetworkInterfaceAttribute(new ModifyNetworkInterfaceAttributeRequest { NetworkInterfaceId = "eni-686ea200", SourceDestCheck = jsondata object });
.NET:
Supported in: 8.0 and newer, Core 3.1
.NET Standard:
Supported in: 2.0
.NET Framework:
Supported in: 4.5 and newer, 3.5