Class CfnNetworkInterfaceAttachment

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.876Z") @Stability(Stable) public class CfnNetworkInterfaceAttachment extends CfnResource implements IInspectable
A CloudFormation AWS::EC2::NetworkInterfaceAttachment.

Attaches an elastic network interface (ENI) to an Amazon EC2 instance. You can use this resource type to attach additional network interfaces to an instance without interruption.

Example:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.services.ec2.*;
 CfnNetworkInterfaceAttachment cfnNetworkInterfaceAttachment = CfnNetworkInterfaceAttachment.Builder.create(this, "MyCfnNetworkInterfaceAttachment")
         .deviceIndex("deviceIndex")
         .instanceId("instanceId")
         .networkInterfaceId("networkInterfaceId")
         // the properties below are optional
         .deleteOnTermination(false)
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnNetworkInterfaceAttachment

      protected CfnNetworkInterfaceAttachment(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnNetworkInterfaceAttachment

      protected CfnNetworkInterfaceAttachment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnNetworkInterfaceAttachment

      @Stability(Stable) public CfnNetworkInterfaceAttachment(@NotNull Construct scope, @NotNull String id, @NotNull CfnNetworkInterfaceAttachmentProps props)
      Create a new AWS::EC2::NetworkInterfaceAttachment.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getDeviceIndex

      @Stability(Stable) @NotNull public String getDeviceIndex()
      The network interface's position in the attachment order.

      For example, the first attached network interface has a DeviceIndex of 0.

    • setDeviceIndex

      @Stability(Stable) public void setDeviceIndex(@NotNull String value)
      The network interface's position in the attachment order.

      For example, the first attached network interface has a DeviceIndex of 0.

    • getInstanceId

      @Stability(Stable) @NotNull public String getInstanceId()
      The ID of the instance to which you will attach the ENI.
    • setInstanceId

      @Stability(Stable) public void setInstanceId(@NotNull String value)
      The ID of the instance to which you will attach the ENI.
    • getNetworkInterfaceId

      @Stability(Stable) @NotNull public String getNetworkInterfaceId()
      The ID of the ENI that you want to attach.
    • setNetworkInterfaceId

      @Stability(Stable) public void setNetworkInterfaceId(@NotNull String value)
      The ID of the ENI that you want to attach.
    • getDeleteOnTermination

      @Stability(Stable) @Nullable public Object getDeleteOnTermination()
      Whether to delete the network interface when the instance terminates.

      By default, this value is set to true .

    • setDeleteOnTermination

      @Stability(Stable) public void setDeleteOnTermination(@Nullable Boolean value)
      Whether to delete the network interface when the instance terminates.

      By default, this value is set to true .

    • setDeleteOnTermination

      @Stability(Stable) public void setDeleteOnTermination(@Nullable IResolvable value)
      Whether to delete the network interface when the instance terminates.

      By default, this value is set to true .