Class CfnNetworkInterface

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.871Z") @Stability(Stable) public class CfnNetworkInterface extends CfnResource implements IInspectable
A CloudFormation AWS::EC2::NetworkInterface.

Describes a network interface in an Amazon EC2 instance for AWS CloudFormation .

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.*;
 CfnNetworkInterface cfnNetworkInterface = CfnNetworkInterface.Builder.create(this, "MyCfnNetworkInterface")
         .subnetId("subnetId")
         // the properties below are optional
         .description("description")
         .groupSet(List.of("groupSet"))
         .interfaceType("interfaceType")
         .ipv6AddressCount(123)
         .ipv6Addresses(List.of(InstanceIpv6AddressProperty.builder()
                 .ipv6Address("ipv6Address")
                 .build()))
         .privateIpAddress("privateIpAddress")
         .privateIpAddresses(List.of(PrivateIpAddressSpecificationProperty.builder()
                 .primary(false)
                 .privateIpAddress("privateIpAddress")
                 .build()))
         .secondaryPrivateIpAddressCount(123)
         .sourceDestCheck(false)
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .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

    • CfnNetworkInterface

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

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

      @Stability(Stable) public CfnNetworkInterface(@NotNull Construct scope, @NotNull String id, @NotNull CfnNetworkInterfaceProps props)
      Create a new AWS::EC2::NetworkInterface.

      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.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The ID of the network interface.
    • getAttrPrimaryPrivateIpAddress

      @Stability(Stable) @NotNull public String getAttrPrimaryPrivateIpAddress()
      The primary private IP address of the network interface.

      For example, 10.0.0.192 .

    • getAttrSecondaryPrivateIpAddresses

      @Stability(Stable) @NotNull public List<String> getAttrSecondaryPrivateIpAddresses()
      The secondary private IP addresses of the network interface.

      For example, ["10.0.0.161", "10.0.0.162", "10.0.0.163"] .

    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      An arbitrary set of tags (key-value pairs) for this network interface.
    • getSubnetId

      @Stability(Stable) @NotNull public String getSubnetId()
      The ID of the subnet to associate with the network interface.
    • setSubnetId

      @Stability(Stable) public void setSubnetId(@NotNull String value)
      The ID of the subnet to associate with the network interface.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      A description for the network interface.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      A description for the network interface.
    • getGroupSet

      @Stability(Stable) @Nullable public List<String> getGroupSet()
      The security group IDs associated with this network interface.
    • setGroupSet

      @Stability(Stable) public void setGroupSet(@Nullable List<String> value)
      The security group IDs associated with this network interface.
    • getInterfaceType

      @Stability(Stable) @Nullable public String getInterfaceType()
      The type of network interface.

      The default is interface . The supported values are efa and trunk .

    • setInterfaceType

      @Stability(Stable) public void setInterfaceType(@Nullable String value)
      The type of network interface.

      The default is interface . The supported values are efa and trunk .

    • getIpv6AddressCount

      @Stability(Stable) @Nullable public Number getIpv6AddressCount()
      The number of IPv6 addresses to assign to a network interface.

      Amazon EC2 automatically selects the IPv6 addresses from the subnet range. To specify specific IPv6 addresses, use the Ipv6Addresses property and don't specify this property.

    • setIpv6AddressCount

      @Stability(Stable) public void setIpv6AddressCount(@Nullable Number value)
      The number of IPv6 addresses to assign to a network interface.

      Amazon EC2 automatically selects the IPv6 addresses from the subnet range. To specify specific IPv6 addresses, use the Ipv6Addresses property and don't specify this property.

    • getIpv6Addresses

      @Stability(Stable) @Nullable public Object getIpv6Addresses()
      One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.

      If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don't specify this property.

    • setIpv6Addresses

      @Stability(Stable) public void setIpv6Addresses(@Nullable IResolvable value)
      One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.

      If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don't specify this property.

    • setIpv6Addresses

      @Stability(Stable) public void setIpv6Addresses(@Nullable List<Object> value)
      One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.

      If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount property and don't specify this property.

    • getPrivateIpAddress

      @Stability(Stable) @Nullable public String getPrivateIpAddress()
      Assigns a single private IP address to the network interface, which is used as the primary private IP address.

      If you want to specify multiple private IP address, use the PrivateIpAddresses property.

    • setPrivateIpAddress

      @Stability(Stable) public void setPrivateIpAddress(@Nullable String value)
      Assigns a single private IP address to the network interface, which is used as the primary private IP address.

      If you want to specify multiple private IP address, use the PrivateIpAddresses property.

    • getPrivateIpAddresses

      @Stability(Stable) @Nullable public Object getPrivateIpAddresses()
      Assigns private IP addresses to the network interface.

      You can specify a primary private IP address by setting the value of the Primary property to true in the PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the SecondaryPrivateIpAddressCount property and do not specify this property.

    • setPrivateIpAddresses

      @Stability(Stable) public void setPrivateIpAddresses(@Nullable IResolvable value)
      Assigns private IP addresses to the network interface.

      You can specify a primary private IP address by setting the value of the Primary property to true in the PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the SecondaryPrivateIpAddressCount property and do not specify this property.

    • setPrivateIpAddresses

      @Stability(Stable) public void setPrivateIpAddresses(@Nullable List<Object> value)
      Assigns private IP addresses to the network interface.

      You can specify a primary private IP address by setting the value of the Primary property to true in the PrivateIpAddressSpecification property. If you want EC2 to automatically assign private IP addresses, use the SecondaryPrivateIpAddressCount property and do not specify this property.

    • getSecondaryPrivateIpAddressCount

      @Stability(Stable) @Nullable public Number getSecondaryPrivateIpAddressCount()
      The number of secondary private IPv4 addresses to assign to a network interface.

      When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address using privateIpAddresses .

      You can't specify a count of private IPv4 addresses if you've specified one of the following: specific private IPv4 addresses, specific IPv4 prefixes, or a count of IPv4 prefixes.

    • setSecondaryPrivateIpAddressCount

      @Stability(Stable) public void setSecondaryPrivateIpAddressCount(@Nullable Number value)
      The number of secondary private IPv4 addresses to assign to a network interface.

      When you specify a number of secondary IPv4 addresses, Amazon EC2 selects these IP addresses within the subnet's IPv4 CIDR range. You can't specify this option and specify more than one private IP address using privateIpAddresses .

      You can't specify a count of private IPv4 addresses if you've specified one of the following: specific private IPv4 addresses, specific IPv4 prefixes, or a count of IPv4 prefixes.

    • getSourceDestCheck

      @Stability(Stable) @Nullable public Object getSourceDestCheck()
      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 true , source/destination checks are enabled; otherwise, they are disabled. The default value is true . You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.

    • setSourceDestCheck

      @Stability(Stable) public void setSourceDestCheck(@Nullable Boolean value)
      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 true , source/destination checks are enabled; otherwise, they are disabled. The default value is true . You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.

    • setSourceDestCheck

      @Stability(Stable) public void setSourceDestCheck(@Nullable IResolvable value)
      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 true , source/destination checks are enabled; otherwise, they are disabled. The default value is true . You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.