Class CfnNetworkInterfaceProps.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.CfnNetworkInterfaceProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnNetworkInterfaceProps>
- Enclosing interface:
- CfnNetworkInterfaceProps
@Stability(Stable)
public static final class CfnNetworkInterfaceProps.Builder
extends Object
implements software.amazon.jsii.Builder<CfnNetworkInterfaceProps>
A builder for
CfnNetworkInterfaceProps
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.description
(String description) Sets the value ofCfnNetworkInterfaceProps.getDescription()
Sets the value ofCfnNetworkInterfaceProps.getGroupSet()
interfaceType
(String interfaceType) Sets the value ofCfnNetworkInterfaceProps.getInterfaceType()
ipv6AddressCount
(Number ipv6AddressCount) Sets the value ofCfnNetworkInterfaceProps.getIpv6AddressCount()
ipv6Addresses
(List<? extends Object> ipv6Addresses) Sets the value ofCfnNetworkInterfaceProps.getIpv6Addresses()
ipv6Addresses
(IResolvable ipv6Addresses) Sets the value ofCfnNetworkInterfaceProps.getIpv6Addresses()
privateIpAddress
(String privateIpAddress) Sets the value ofCfnNetworkInterfaceProps.getPrivateIpAddress()
privateIpAddresses
(List<? extends Object> privateIpAddresses) Sets the value ofCfnNetworkInterfaceProps.getPrivateIpAddresses()
privateIpAddresses
(IResolvable privateIpAddresses) Sets the value ofCfnNetworkInterfaceProps.getPrivateIpAddresses()
secondaryPrivateIpAddressCount
(Number secondaryPrivateIpAddressCount) Sets the value ofCfnNetworkInterfaceProps.getSecondaryPrivateIpAddressCount()
sourceDestCheck
(Boolean sourceDestCheck) Sets the value ofCfnNetworkInterfaceProps.getSourceDestCheck()
sourceDestCheck
(IResolvable sourceDestCheck) Sets the value ofCfnNetworkInterfaceProps.getSourceDestCheck()
Sets the value ofCfnNetworkInterfaceProps.getSubnetId()
Sets the value ofCfnNetworkInterfaceProps.getTags()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
subnetId
Sets the value ofCfnNetworkInterfaceProps.getSubnetId()
- Parameters:
subnetId
- The ID of the subnet to associate with the network interface. This parameter is required.- Returns:
this
-
description
Sets the value ofCfnNetworkInterfaceProps.getDescription()
- Parameters:
description
- A description for the network interface.- Returns:
this
-
groupSet
Sets the value ofCfnNetworkInterfaceProps.getGroupSet()
- Parameters:
groupSet
- The security group IDs associated with this network interface.- Returns:
this
-
interfaceType
Sets the value ofCfnNetworkInterfaceProps.getInterfaceType()
- Parameters:
interfaceType
- The type of network interface. The default isinterface
. The supported values areefa
andtrunk
.- Returns:
this
-
ipv6AddressCount
@Stability(Stable) public CfnNetworkInterfaceProps.Builder ipv6AddressCount(Number ipv6AddressCount) Sets the value ofCfnNetworkInterfaceProps.getIpv6AddressCount()
- Parameters:
ipv6AddressCount
- 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 theIpv6Addresses
property and don't specify this property.- Returns:
this
-
ipv6Addresses
Sets the value ofCfnNetworkInterfaceProps.getIpv6Addresses()
- Parameters:
ipv6Addresses
- 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 theIpv6AddressCount
property and don't specify this property.- Returns:
this
-
ipv6Addresses
@Stability(Stable) public CfnNetworkInterfaceProps.Builder ipv6Addresses(List<? extends Object> ipv6Addresses) Sets the value ofCfnNetworkInterfaceProps.getIpv6Addresses()
- Parameters:
ipv6Addresses
- 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 theIpv6AddressCount
property and don't specify this property.- Returns:
this
-
privateIpAddress
@Stability(Stable) public CfnNetworkInterfaceProps.Builder privateIpAddress(String privateIpAddress) Sets the value ofCfnNetworkInterfaceProps.getPrivateIpAddress()
- Parameters:
privateIpAddress
- 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 thePrivateIpAddresses
property.- Returns:
this
-
privateIpAddresses
@Stability(Stable) public CfnNetworkInterfaceProps.Builder privateIpAddresses(IResolvable privateIpAddresses) Sets the value ofCfnNetworkInterfaceProps.getPrivateIpAddresses()
- Parameters:
privateIpAddresses
- Assigns private IP addresses to the network interface. You can specify a primary private IP address by setting the value of thePrimary
property totrue
in thePrivateIpAddressSpecification
property. If you want EC2 to automatically assign private IP addresses, use theSecondaryPrivateIpAddressCount
property and do not specify this property.- Returns:
this
-
privateIpAddresses
@Stability(Stable) public CfnNetworkInterfaceProps.Builder privateIpAddresses(List<? extends Object> privateIpAddresses) Sets the value ofCfnNetworkInterfaceProps.getPrivateIpAddresses()
- Parameters:
privateIpAddresses
- Assigns private IP addresses to the network interface. You can specify a primary private IP address by setting the value of thePrimary
property totrue
in thePrivateIpAddressSpecification
property. If you want EC2 to automatically assign private IP addresses, use theSecondaryPrivateIpAddressCount
property and do not specify this property.- Returns:
this
-
secondaryPrivateIpAddressCount
@Stability(Stable) public CfnNetworkInterfaceProps.Builder secondaryPrivateIpAddressCount(Number secondaryPrivateIpAddressCount) Sets the value ofCfnNetworkInterfaceProps.getSecondaryPrivateIpAddressCount()
- Parameters:
secondaryPrivateIpAddressCount
- 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 usingprivateIpAddresses
.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.
- Returns:
this
-
sourceDestCheck
Sets the value ofCfnNetworkInterfaceProps.getSourceDestCheck()
- Parameters:
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 istrue
, source/destination checks are enabled; otherwise, they are disabled. The default value istrue
. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.- Returns:
this
-
sourceDestCheck
@Stability(Stable) public CfnNetworkInterfaceProps.Builder sourceDestCheck(IResolvable sourceDestCheck) Sets the value ofCfnNetworkInterfaceProps.getSourceDestCheck()
- Parameters:
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 istrue
, source/destination checks are enabled; otherwise, they are disabled. The default value istrue
. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.- Returns:
this
-
tags
Sets the value ofCfnNetworkInterfaceProps.getTags()
- Parameters:
tags
- An arbitrary set of tags (key-value pairs) for this network interface.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnNetworkInterfaceProps>
- Returns:
- a new instance of
CfnNetworkInterfaceProps
- Throws:
NullPointerException
- if any required attribute was not provided
-