Class CfnNetworkInterface
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnNetworkInterface.static interfaceDescribes the IPv6 addresses to associate with the network interface.static interfaceDescribes a secondary private IPv4 address for a network interface.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCfnNetworkInterface(Construct scope, String id, CfnNetworkInterfaceProps props) Create a newAWS::EC2::NetworkInterface.protectedCfnNetworkInterface(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnNetworkInterface(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionThe ID of the network interface.The primary private IP address of the network interface.The secondary private IP addresses of the network interface.A description for the network interface.The security group IDs associated with this network interface.The type of network interface.The number of IPv6 addresses to assign to a network interface.One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.Assigns a single private IP address to the network interface, which is used as the primary private IP address.Assigns private IP addresses to the network interface.The number of secondary private IPv4 addresses to assign to a network interface.Enable or disable source/destination checks, which ensure that the instance is either the source or the destination of any traffic that it receives.The ID of the subnet to associate with the network interface.getTags()An arbitrary set of tags (key-value pairs) for this network interface.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetDescription(String value) A description for the network interface.voidsetGroupSet(List<String> value) The security group IDs associated with this network interface.voidsetInterfaceType(String value) The type of network interface.voidsetIpv6AddressCount(Number value) The number of IPv6 addresses to assign to a network interface.voidsetIpv6Addresses(List<Object> value) One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.voidsetIpv6Addresses(IResolvable value) One or more specific IPv6 addresses from the IPv6 CIDR block range of your subnet to associate with the network interface.voidsetPrivateIpAddress(String value) Assigns a single private IP address to the network interface, which is used as the primary private IP address.voidsetPrivateIpAddresses(List<Object> value) Assigns private IP addresses to the network interface.voidsetPrivateIpAddresses(IResolvable value) Assigns private IP addresses to the network interface.voidThe number of secondary private IPv4 addresses to assign to a network interface.voidsetSourceDestCheck(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.voidsetSourceDestCheck(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.voidsetSubnetId(String value) The ID of the subnet to associate with the network interface.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 newAWS::EC2::NetworkInterface.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrId
The ID of the network interface. -
getAttrPrimaryPrivateIpAddress
The primary private IP address of the network interface.For example,
10.0.0.192. -
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
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
An arbitrary set of tags (key-value pairs) for this network interface. -
getSubnetId
The ID of the subnet to associate with the network interface. -
setSubnetId
The ID of the subnet to associate with the network interface. -
getDescription
A description for the network interface. -
setDescription
A description for the network interface. -
getGroupSet
The security group IDs associated with this network interface. -
setGroupSet
The security group IDs associated with this network interface. -
getInterfaceType
The type of network interface.The default is
interface. The supported values areefaandtrunk. -
setInterfaceType
The type of network interface.The default is
interface. The supported values areefaandtrunk. -
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
Ipv6Addressesproperty and don't specify this property. -
setIpv6AddressCount
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
Ipv6Addressesproperty and don't specify this property. -
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
Ipv6AddressCountproperty and don't specify this property. -
setIpv6Addresses
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
Ipv6AddressCountproperty and don't specify this property. -
setIpv6Addresses
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
Ipv6AddressCountproperty and don't specify this property. -
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
PrivateIpAddressesproperty. -
setPrivateIpAddress
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
PrivateIpAddressesproperty. -
getPrivateIpAddresses
Assigns private IP addresses to the network interface.You can specify a primary private IP address by setting the value of the
Primaryproperty totruein thePrivateIpAddressSpecificationproperty. If you want EC2 to automatically assign private IP addresses, use theSecondaryPrivateIpAddressCountproperty and do not specify this property. -
setPrivateIpAddresses
Assigns private IP addresses to the network interface.You can specify a primary private IP address by setting the value of the
Primaryproperty totruein thePrivateIpAddressSpecificationproperty. If you want EC2 to automatically assign private IP addresses, use theSecondaryPrivateIpAddressCountproperty and do not specify this property. -
setPrivateIpAddresses
Assigns private IP addresses to the network interface.You can specify a primary private IP address by setting the value of the
Primaryproperty totruein thePrivateIpAddressSpecificationproperty. If you want EC2 to automatically assign private IP addresses, use theSecondaryPrivateIpAddressCountproperty and do not specify this property. -
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
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
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 istrue. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls. -
setSourceDestCheck
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 istrue. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls. -
setSourceDestCheck
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 istrue. You must disable source/destination checks if the instance runs services such as network address translation, routing, or firewalls.
-