Class CfnInstance.NetworkInterfaceProperty.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.CfnInstance.NetworkInterfaceProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnInstance.NetworkInterfaceProperty>
- Enclosing interface:
CfnInstance.NetworkInterfaceProperty
@Stability(Stable)
public static final class CfnInstance.NetworkInterfaceProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnInstance.NetworkInterfaceProperty>
A builder for
CfnInstance.NetworkInterfaceProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassociateCarrierIpAddress
(Boolean associateCarrierIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getAssociateCarrierIpAddress()
associateCarrierIpAddress
(IResolvable associateCarrierIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getAssociateCarrierIpAddress()
associatePublicIpAddress
(Boolean associatePublicIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getAssociatePublicIpAddress()
associatePublicIpAddress
(IResolvable associatePublicIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getAssociatePublicIpAddress()
build()
Builds the configured instance.deleteOnTermination
(Boolean deleteOnTermination) Sets the value ofCfnInstance.NetworkInterfaceProperty.getDeleteOnTermination()
deleteOnTermination
(IResolvable deleteOnTermination) Sets the value ofCfnInstance.NetworkInterfaceProperty.getDeleteOnTermination()
description
(String description) Sets the value ofCfnInstance.NetworkInterfaceProperty.getDescription()
deviceIndex
(String deviceIndex) Sets the value ofCfnInstance.NetworkInterfaceProperty.getDeviceIndex()
Sets the value ofCfnInstance.NetworkInterfaceProperty.getGroupSet()
ipv6AddressCount
(Number ipv6AddressCount) Sets the value ofCfnInstance.NetworkInterfaceProperty.getIpv6AddressCount()
ipv6Addresses
(List<? extends Object> ipv6Addresses) Sets the value ofCfnInstance.NetworkInterfaceProperty.getIpv6Addresses()
ipv6Addresses
(IResolvable ipv6Addresses) Sets the value ofCfnInstance.NetworkInterfaceProperty.getIpv6Addresses()
networkInterfaceId
(String networkInterfaceId) Sets the value ofCfnInstance.NetworkInterfaceProperty.getNetworkInterfaceId()
privateIpAddress
(String privateIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getPrivateIpAddress()
privateIpAddresses
(List<? extends Object> privateIpAddresses) Sets the value ofCfnInstance.NetworkInterfaceProperty.getPrivateIpAddresses()
privateIpAddresses
(IResolvable privateIpAddresses) Sets the value ofCfnInstance.NetworkInterfaceProperty.getPrivateIpAddresses()
secondaryPrivateIpAddressCount
(Number secondaryPrivateIpAddressCount) Sets the value ofCfnInstance.NetworkInterfaceProperty.getSecondaryPrivateIpAddressCount()
Sets the value ofCfnInstance.NetworkInterfaceProperty.getSubnetId()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
deviceIndex
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder deviceIndex(String deviceIndex) Sets the value ofCfnInstance.NetworkInterfaceProperty.getDeviceIndex()
- Parameters:
deviceIndex
- The position of the network interface in the attachment order. This parameter is required. A primary network interface has a device index of 0.If you create a network interface when launching an instance, you must specify the device index.
- Returns:
this
-
associateCarrierIpAddress
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder associateCarrierIpAddress(Boolean associateCarrierIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getAssociateCarrierIpAddress()
- Parameters:
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 AWS Wavelength Developer Guide .- Returns:
this
-
associateCarrierIpAddress
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder associateCarrierIpAddress(IResolvable associateCarrierIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getAssociateCarrierIpAddress()
- Parameters:
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 AWS Wavelength Developer Guide .- Returns:
this
-
associatePublicIpAddress
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder associatePublicIpAddress(Boolean associatePublicIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getAssociatePublicIpAddress()
- Parameters:
associatePublicIpAddress
- Indicates whether to assign a public IPv4 address to an instance. Applies only if creating a network interface when launching an instance. The network interface must be the primary network interface. If launching into a default subnet, the default value istrue
.AWS 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 VPC pricing page .
- Returns:
this
-
associatePublicIpAddress
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder associatePublicIpAddress(IResolvable associatePublicIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getAssociatePublicIpAddress()
- Parameters:
associatePublicIpAddress
- Indicates whether to assign a public IPv4 address to an instance. Applies only if creating a network interface when launching an instance. The network interface must be the primary network interface. If launching into a default subnet, the default value istrue
.AWS 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 VPC pricing page .
- Returns:
this
-
deleteOnTermination
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder deleteOnTermination(Boolean deleteOnTermination) Sets the value ofCfnInstance.NetworkInterfaceProperty.getDeleteOnTermination()
- Parameters:
deleteOnTermination
- Indicates whether the network interface is deleted when the instance is terminated. Applies only if creating a network interface when launching an instance.- Returns:
this
-
deleteOnTermination
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder deleteOnTermination(IResolvable deleteOnTermination) Sets the value ofCfnInstance.NetworkInterfaceProperty.getDeleteOnTermination()
- Parameters:
deleteOnTermination
- Indicates whether the network interface is deleted when the instance is terminated. Applies only if creating a network interface when launching an instance.- Returns:
this
-
description
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder description(String description) Sets the value ofCfnInstance.NetworkInterfaceProperty.getDescription()
- Parameters:
description
- The description of the network interface. Applies only if creating a network interface when launching an instance.- Returns:
this
-
groupSet
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder groupSet(List<String> groupSet) Sets the value ofCfnInstance.NetworkInterfaceProperty.getGroupSet()
- Parameters:
groupSet
- The IDs of the security groups for the network interface. Applies only if creating a network interface when launching an instance.- Returns:
this
-
ipv6AddressCount
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder ipv6AddressCount(Number ipv6AddressCount) Sets the value ofCfnInstance.NetworkInterfaceProperty.getIpv6AddressCount()
- Parameters:
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:
this
-
ipv6Addresses
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder ipv6Addresses(IResolvable ipv6Addresses) Sets the value ofCfnInstance.NetworkInterfaceProperty.getIpv6Addresses()
- Parameters:
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.- Returns:
this
-
ipv6Addresses
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder ipv6Addresses(List<? extends Object> ipv6Addresses) Sets the value ofCfnInstance.NetworkInterfaceProperty.getIpv6Addresses()
- Parameters:
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.- Returns:
this
-
networkInterfaceId
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder networkInterfaceId(String networkInterfaceId) Sets the value ofCfnInstance.NetworkInterfaceProperty.getNetworkInterfaceId()
- Parameters:
networkInterfaceId
- The ID of the network interface, when attaching an existing network interface.- Returns:
this
-
privateIpAddress
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder privateIpAddress(String privateIpAddress) Sets the value ofCfnInstance.NetworkInterfaceProperty.getPrivateIpAddress()
- Parameters:
privateIpAddress
- The private IPv4 address of the network interface. Applies only if creating a network interface when launching an instance.- Returns:
this
-
privateIpAddresses
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder privateIpAddresses(IResolvable privateIpAddresses) Sets the value ofCfnInstance.NetworkInterfaceProperty.getPrivateIpAddresses()
- Parameters:
privateIpAddresses
- One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary.- Returns:
this
-
privateIpAddresses
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder privateIpAddresses(List<? extends Object> privateIpAddresses) Sets the value ofCfnInstance.NetworkInterfaceProperty.getPrivateIpAddresses()
- Parameters:
privateIpAddresses
- One or more private IPv4 addresses to assign to the network interface. Only one private IPv4 address can be designated as primary.- Returns:
this
-
secondaryPrivateIpAddressCount
@Stability(Stable) public CfnInstance.NetworkInterfaceProperty.Builder secondaryPrivateIpAddressCount(Number secondaryPrivateIpAddressCount) Sets the value ofCfnInstance.NetworkInterfaceProperty.getSecondaryPrivateIpAddressCount()
- Parameters:
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.- Returns:
this
-
subnetId
Sets the value ofCfnInstance.NetworkInterfaceProperty.getSubnetId()
- Parameters:
subnetId
- The ID of the subnet associated with the network interface.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnInstance.NetworkInterfaceProperty>
- Returns:
- a new instance of
CfnInstance.NetworkInterfaceProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-