Class CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty>
- Enclosing interface:
CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty
@Stability(Stable)
public static final class CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionassociatePublicIpAddress
(Boolean associatePublicIpAddress) associatePublicIpAddress
(IResolvable associatePublicIpAddress) build()
Builds the configured instance.deleteOnTermination
(Boolean deleteOnTermination) deleteOnTermination
(IResolvable deleteOnTermination) description
(String description) deviceIndex
(Number deviceIndex) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getGroups()
ipv6AddressCount
(Number ipv6AddressCount) ipv6Addresses
(List<? extends Object> ipv6Addresses) ipv6Addresses
(IResolvable ipv6Addresses) networkInterfaceId
(String networkInterfaceId) privateIpAddresses
(List<? extends Object> privateIpAddresses) privateIpAddresses
(IResolvable privateIpAddresses) secondaryPrivateIpAddressCount
(Number secondaryPrivateIpAddressCount) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getSubnetId()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
associatePublicIpAddress
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder associatePublicIpAddress(Boolean associatePublicIpAddress) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getAssociatePublicIpAddress()
- Parameters:
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 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 Amazon VPC pricing page .
- Returns:
this
-
associatePublicIpAddress
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder associatePublicIpAddress(IResolvable associatePublicIpAddress) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getAssociatePublicIpAddress()
- Parameters:
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 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 Amazon VPC pricing page .
- Returns:
this
-
deleteOnTermination
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder deleteOnTermination(Boolean deleteOnTermination) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getDeleteOnTermination()
- Parameters:
deleteOnTermination
- Indicates whether the network interface is deleted when the instance is terminated.- Returns:
this
-
deleteOnTermination
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder deleteOnTermination(IResolvable deleteOnTermination) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getDeleteOnTermination()
- Parameters:
deleteOnTermination
- Indicates whether the network interface is deleted when the instance is terminated.- Returns:
this
-
description
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder description(String description) - Parameters:
description
- The description of the network interface. Applies only if creating a network interface when launching an instance.- Returns:
this
-
deviceIndex
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder deviceIndex(Number deviceIndex) - Parameters:
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:
this
-
groups
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder groups(List<String> groups) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getGroups()
- Parameters:
groups
- 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 CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder ipv6AddressCount(Number ipv6AddressCount) - 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 CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder ipv6Addresses(IResolvable ipv6Addresses) - 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 CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder ipv6Addresses(List<? extends Object> ipv6Addresses) - 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 CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder networkInterfaceId(String networkInterfaceId) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getNetworkInterfaceId()
- Parameters:
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:
this
-
privateIpAddresses
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder privateIpAddresses(IResolvable privateIpAddresses) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getPrivateIpAddresses()
- Parameters:
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.- Returns:
this
-
privateIpAddresses
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder privateIpAddresses(List<? extends Object> privateIpAddresses) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getPrivateIpAddresses()
- Parameters:
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.- Returns:
this
-
secondaryPrivateIpAddressCount
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder secondaryPrivateIpAddressCount(Number secondaryPrivateIpAddressCount) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.getSecondaryPrivateIpAddressCount()
- Parameters:
secondaryPrivateIpAddressCount
- The number of secondary private IPv4 addresses. You can’t specify this parameter and also specify a secondary private IP address using thePrivateIpAddress
parameter.- Returns:
this
-
subnetId
@Stability(Stable) public CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.Builder subnetId(String subnetId) Sets the value ofCfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty.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<CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty>
- Returns:
- a new instance of
CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-