Class InstanceNetworkInterfaceSpecification

java.lang.Object
software.amazon.awssdk.services.ec2.model.InstanceNetworkInterfaceSpecification
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<InstanceNetworkInterfaceSpecification.Builder,InstanceNetworkInterfaceSpecification>

@Generated("software.amazon.awssdk:codegen") public final class InstanceNetworkInterfaceSpecification extends Object implements SdkPojo, Serializable, ToCopyableBuilder<InstanceNetworkInterfaceSpecification.Builder,InstanceNetworkInterfaceSpecification>

Describes a network interface.

See Also:
  • Method Details

    • associatePublicIpAddress

      public final Boolean associatePublicIpAddress()

      Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true.

      Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page.

      Returns:
      Indicates whether to assign a public IPv4 address to an instance you launch in a VPC. The public IP address can only be assigned to a network interface for eth0, and can only be assigned to a new network interface, not an existing one. You cannot specify more than one network interface in the request. If launching into a default subnet, the default value is true.

      Amazon Web Services charges for all public IPv4 addresses, including public IPv4 addresses associated with running instances and Elastic IP addresses. For more information, see the Public IPv4 Address tab on the Amazon VPC pricing page.

    • deleteOnTermination

      public final Boolean deleteOnTermination()

      If set to true, the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.

      Returns:
      If set to true, the interface is deleted when the instance is terminated. You can specify true only if creating a new network interface when launching an instance.
    • description

      public final String description()

      The description of the network interface. Applies only if creating a network interface when launching an instance.

      Returns:
      The description of the network interface. Applies only if creating a network interface when launching an instance.
    • deviceIndex

      public final Integer deviceIndex()

      The position of the network interface in the attachment order. A primary network interface has a device index of 0.

      If you specify a network interface when launching an instance, you must specify the device index.

      Returns:
      The position of the network interface in the attachment order. A primary network interface has a device index of 0.

      If you specify a network interface when launching an instance, you must specify the device index.

    • hasGroups

      public final boolean hasGroups()
      For responses, this returns true if the service returned a value for the Groups property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • groups

      public final List<String> groups()

      The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasGroups() method.

      Returns:
      The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.
    • ipv6AddressCount

      public final Integer ipv6AddressCount()

      A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.

      Returns:
      A number of IPv6 addresses to assign to the network interface. Amazon EC2 chooses the IPv6 addresses from the range of the subnet. You cannot specify this option and the option to assign specific IPv6 addresses in the same request. You can specify this option if you've specified a minimum number of instances to launch.
    • hasIpv6Addresses

      public final boolean hasIpv6Addresses()
      For responses, this returns true if the service returned a value for the Ipv6Addresses property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • ipv6Addresses

      public final List<InstanceIpv6Address> ipv6Addresses()

      The IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasIpv6Addresses() method.

      Returns:
      The IPv6 addresses to assign to the network interface. You cannot specify this option and the option to assign a number of IPv6 addresses in the same request. You cannot specify this option if you've specified a minimum number of instances to launch.
    • networkInterfaceId

      public final String networkInterfaceId()

      The ID of the network interface.

      If you are creating a Spot Fleet, omit this parameter because you can’t specify a network interface ID in a launch specification.

      Returns:
      The ID of the network interface.

      If you are creating a Spot Fleet, omit this parameter because you can’t specify a network interface ID in a launch specification.

    • privateIpAddress

      public final String privateIpAddress()

      The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.

      Returns:
      The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance. You cannot specify this option if you're launching more than one instance in a RunInstances request.
    • hasPrivateIpAddresses

      public final boolean hasPrivateIpAddresses()
      For responses, this returns true if the service returned a value for the PrivateIpAddresses property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • privateIpAddresses

      public final List<PrivateIpAddressSpecification> privateIpAddresses()

      The private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasPrivateIpAddresses() method.

      Returns:
      The private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary. You cannot specify this option if you're launching more than one instance in a RunInstances request.
    • secondaryPrivateIpAddressCount

      public final Integer secondaryPrivateIpAddressCount()

      The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.

      Returns:
      The number of secondary private IPv4 addresses. You can't specify this option and specify more than one private IP address using the private IP addresses option. You cannot specify this option if you're launching more than one instance in a RunInstances request.
    • subnetId

      public final String subnetId()

      The ID of the subnet associated with the network interface. Applies only if creating a network interface when launching an instance.

      Returns:
      The ID of the subnet associated with the network interface. Applies only if creating a network interface when launching an instance.
    • associateCarrierIpAddress

      public final Boolean associateCarrierIpAddress()

      Indicates whether to assign a carrier IP address to the network interface.

      You can only assign a carrier IP address to a network interface that is in a subnet in a Wavelength Zone. For more information about carrier IP addresses, see Carrier IP address in the Amazon Web Services Wavelength Developer Guide.

      Returns:
      Indicates whether to assign a carrier IP address to the network interface.

      You can only assign a carrier IP address to a network interface that is in a subnet in a Wavelength Zone. For more information about carrier IP addresses, see Carrier IP address in the Amazon Web Services Wavelength Developer Guide.

    • interfaceType

      public final String interfaceType()

      The type of network interface.

      Valid values: interface | efa

      Returns:
      The type of network interface.

      Valid values: interface | efa

    • networkCardIndex

      public final Integer networkCardIndex()

      The index of the network card. Some instance types support multiple network cards. The primary network interface must be assigned to network card index 0. The default is network card index 0.

      If you are using RequestSpotInstances to create Spot Instances, omit this parameter because you can’t specify the network card index when using this API. To specify the network card index, use RunInstances.

      Returns:
      The index of the network card. Some instance types support multiple network cards. The primary network interface must be assigned to network card index 0. The default is network card index 0.

      If you are using RequestSpotInstances to create Spot Instances, omit this parameter because you can’t specify the network card index when using this API. To specify the network card index, use RunInstances.

    • hasIpv4Prefixes

      public final boolean hasIpv4Prefixes()
      For responses, this returns true if the service returned a value for the Ipv4Prefixes property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • ipv4Prefixes

      public final List<Ipv4PrefixSpecificationRequest> ipv4Prefixes()

      The IPv4 delegated prefixes to be assigned to the network interface. You cannot use this option if you use the Ipv4PrefixCount option.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasIpv4Prefixes() method.

      Returns:
      The IPv4 delegated prefixes to be assigned to the network interface. You cannot use this option if you use the Ipv4PrefixCount option.
    • ipv4PrefixCount

      public final Integer ipv4PrefixCount()

      The number of IPv4 delegated prefixes to be automatically assigned to the network interface. You cannot use this option if you use the Ipv4Prefix option.

      Returns:
      The number of IPv4 delegated prefixes to be automatically assigned to the network interface. You cannot use this option if you use the Ipv4Prefix option.
    • hasIpv6Prefixes

      public final boolean hasIpv6Prefixes()
      For responses, this returns true if the service returned a value for the Ipv6Prefixes property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • ipv6Prefixes

      public final List<Ipv6PrefixSpecificationRequest> ipv6Prefixes()

      The IPv6 delegated prefixes to be assigned to the network interface. You cannot use this option if you use the Ipv6PrefixCount option.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasIpv6Prefixes() method.

      Returns:
      The IPv6 delegated prefixes to be assigned to the network interface. You cannot use this option if you use the Ipv6PrefixCount option.
    • ipv6PrefixCount

      public final Integer ipv6PrefixCount()

      The number of IPv6 delegated prefixes to be automatically assigned to the network interface. You cannot use this option if you use the Ipv6Prefix option.

      Returns:
      The number of IPv6 delegated prefixes to be automatically assigned to the network interface. You cannot use this option if you use the Ipv6Prefix option.
    • primaryIpv6

      public final Boolean primaryIpv6()

      The primary IPv6 address of the network interface. 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. For more information about primary IPv6 addresses, see RunInstances.

      Returns:
      The primary IPv6 address of the network interface. 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. For more information about primary IPv6 addresses, see RunInstances.
    • enaSrdSpecification

      public final EnaSrdSpecificationRequest enaSrdSpecification()

      Specifies the ENA Express settings for the network interface that's attached to the instance.

      Returns:
      Specifies the ENA Express settings for the network interface that's attached to the instance.
    • connectionTrackingSpecification

      public final ConnectionTrackingSpecificationRequest connectionTrackingSpecification()

      A security group connection tracking specification that enables you to set the timeout for connection tracking on an Elastic network interface. For more information, see Connection tracking timeouts in the Amazon Elastic Compute Cloud User Guide.

      Returns:
      A security group connection tracking specification that enables you to set the timeout for connection tracking on an Elastic network interface. For more information, see Connection tracking timeouts in the Amazon Elastic Compute Cloud User Guide.
    • toBuilder

      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<InstanceNetworkInterfaceSpecification.Builder,InstanceNetworkInterfaceSpecification>
      Returns:
      a builder for type T
    • builder

    • serializableBuilderClass

      public static Class<? extends InstanceNetworkInterfaceSpecification.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.