@Generated(value="jsii-pacmak/1.58.0 (build f8ba112)", date="2022-05-20T22:19:59.096Z") public class CfnNetworkInterface extends CfnResource implements IInspectable
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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnNetworkInterface.Builder
A fluent builder for
CfnNetworkInterface . |
static interface |
CfnNetworkInterface.InstanceIpv6AddressProperty
Describes the IPv6 addresses to associate with the network interface.
|
static interface |
CfnNetworkInterface.PrivateIpAddressSpecificationProperty
Describes a secondary private IPv4 address for a network interface.
|
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnNetworkInterface(Construct scope,
java.lang.String id,
CfnNetworkInterfaceProps props)
Create a new `AWS::EC2::NetworkInterface`.
|
protected |
CfnNetworkInterface(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnNetworkInterface(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrId()
The ID of the network interface.
|
java.lang.String |
getAttrPrimaryPrivateIpAddress()
The primary private IP address of the network interface.
|
java.util.List<java.lang.String> |
getAttrSecondaryPrivateIpAddresses()
The secondary private IP addresses of the network interface.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getDescription()
A description for the network interface.
|
java.util.List<java.lang.String> |
getGroupSet()
The security group IDs associated with this network interface.
|
java.lang.String |
getInterfaceType()
The type of network interface.
|
java.lang.Number |
getIpv6AddressCount()
The number of IPv6 addresses to assign to a network interface.
|
java.lang.Object |
getIpv6Addresses()
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.
|
java.lang.String |
getPrivateIpAddress()
Assigns a single private IP address to the network interface, which is used as the primary private IP address.
|
java.lang.Object |
getPrivateIpAddresses()
Assigns private IP addresses to the network interface.
|
java.lang.Number |
getSecondaryPrivateIpAddressCount()
The number of secondary private IPv4 addresses to assign to a network interface.
|
java.lang.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.
|
java.lang.String |
getSubnetId()
The ID of the subnet to associate with the network interface.
|
TagManager |
getTags()
An arbitrary set of tags (key-value pairs) for this network interface.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setDescription(java.lang.String value)
A description for the network interface.
|
void |
setGroupSet(java.util.List<java.lang.String> value)
The security group IDs associated with this network interface.
|
void |
setInterfaceType(java.lang.String value)
The type of network interface.
|
void |
setIpv6AddressCount(java.lang.Number value)
The number of IPv6 addresses to assign to a network interface.
|
void |
setIpv6Addresses(IResolvable value)
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.
|
void |
setIpv6Addresses(java.util.List<java.lang.Object> value)
One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.
|
void |
setPrivateIpAddress(java.lang.String value)
Assigns a single private IP address to the network interface, which is used as the primary private IP address.
|
void |
setPrivateIpAddresses(IResolvable value)
Assigns private IP addresses to the network interface.
|
void |
setPrivateIpAddresses(java.util.List<java.lang.Object> value)
Assigns private IP addresses to the network interface.
|
void |
setSecondaryPrivateIpAddressCount(java.lang.Number value)
The number of secondary private IPv4 addresses to assign to a network interface.
|
void |
setSourceDestCheck(java.lang.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.
|
void |
setSourceDestCheck(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.
|
void |
setSubnetId(java.lang.String value)
The ID of the subnet to associate with the network interface.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnNetworkInterface(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnNetworkInterface(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnNetworkInterface(Construct scope, java.lang.String id, CfnNetworkInterfaceProps props)
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.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.public java.lang.String getAttrId()
public java.lang.String getAttrPrimaryPrivateIpAddress()
For example, 10.0.0.192
.
public java.util.List<java.lang.String> getAttrSecondaryPrivateIpAddresses()
For example, ["10.0.0.161", "10.0.0.162", "10.0.0.163"]
.
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
public java.lang.String getSubnetId()
public void setSubnetId(java.lang.String value)
public java.lang.String getDescription()
public void setDescription(java.lang.String value)
public java.util.List<java.lang.String> getGroupSet()
public void setGroupSet(java.util.List<java.lang.String> value)
public java.lang.String getInterfaceType()
The default is interface
. The supported values are efa
and trunk
.
public void setInterfaceType(java.lang.String value)
The default is interface
. The supported values are efa
and trunk
.
public java.lang.Number getIpv6AddressCount()
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.
public void setIpv6AddressCount(java.lang.Number value)
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.
public java.lang.Object getIpv6Addresses()
If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount
property and don't specify this property.
public void setIpv6Addresses(IResolvable value)
If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount
property and don't specify this property.
public void setIpv6Addresses(java.util.List<java.lang.Object> value)
If you're specifying a number of IPv6 addresses, use the Ipv6AddressCount
property and don't specify this property.
public java.lang.String getPrivateIpAddress()
If you want to specify multiple private IP address, use the PrivateIpAddresses
property.
public void setPrivateIpAddress(java.lang.String value)
If you want to specify multiple private IP address, use the PrivateIpAddresses
property.
public java.lang.Object getPrivateIpAddresses()
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.
public void setPrivateIpAddresses(IResolvable value)
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.
public void setPrivateIpAddresses(java.util.List<java.lang.Object> value)
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.
public java.lang.Number getSecondaryPrivateIpAddressCount()
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
.
The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide .
public void setSecondaryPrivateIpAddressCount(java.lang.Number value)
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
.
The number of IP addresses you can assign to a network interface varies by instance type. For more information, see IP Addresses Per ENI Per Instance Type in the Amazon Virtual Private Cloud User Guide .
public java.lang.Object getSourceDestCheck()
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.
public void setSourceDestCheck(java.lang.Boolean value)
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.
public void setSourceDestCheck(IResolvable value)
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.