Class CfnEIPAssociation
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.ec2.CfnEIPAssociation
- All Implemented Interfaces:
IInspectable,IEIPAssociationRef,IEnvironmentAware,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-12T17:54:11.617Z")
@Stability(Stable)
public class CfnEIPAssociation
extends CfnResource
implements IInspectable, IEIPAssociationRef
Associates an Elastic IP address with an instance or a network interface.
Before you can use an Elastic IP address, you must allocate it to your account. For more information about working with Elastic IP addresses, see Elastic IP address concepts and rules .
You must specify AllocationId and either InstanceId , NetworkInterfaceId , or PrivateIpAddress .
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.*;
CfnEIPAssociation cfnEIPAssociation = CfnEIPAssociation.Builder.create(this, "MyCfnEIPAssociation")
.allocationId("allocationId")
.eip("eip")
.instanceId("instanceId")
.networkInterfaceId("networkInterfaceId")
.privateIpAddress("privateIpAddress")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.ec2.IEIPAssociationRef
IEIPAssociationRef.Jsii$Default, IEIPAssociationRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnEIPAssociation(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnEIPAssociation(software.amazon.jsii.JsiiObjectRef objRef) CfnEIPAssociation(software.constructs.Construct scope, String id) Create a newAWS::EC2::EIPAssociation.CfnEIPAssociation(software.constructs.Construct scope, String id, CfnEIPAssociationProps props) Create a newAWS::EC2::EIPAssociation. -
Method Summary
Modifier and TypeMethodDescriptionThe allocation ID.The ID of the association.getEip()Deprecated.this property has been deprecatedA reference to a EIPAssociation resource.The ID of the instance.The ID of the network interface.The primary or secondary private IP address to associate with the Elastic IP address.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnEIPAssociation.renderProperties(Map<String, Object> props) voidsetAllocationId(String value) The allocation ID.voidDeprecated.this property has been deprecatedvoidsetInstanceId(String value) The ID of the instance.voidsetNetworkInterfaceId(String value) The ID of the network interface.voidsetPrivateIpAddress(String value) The primary or secondary private IP address to associate with the Elastic IP address.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods 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.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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
-
CfnEIPAssociation
protected CfnEIPAssociation(software.amazon.jsii.JsiiObjectRef objRef) -
CfnEIPAssociation
protected CfnEIPAssociation(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnEIPAssociation
@Stability(Stable) public CfnEIPAssociation(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable CfnEIPAssociationProps props) Create a newAWS::EC2::EIPAssociation.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties.
-
CfnEIPAssociation
@Stability(Stable) public CfnEIPAssociation(@NotNull software.constructs.Construct scope, @NotNull String id) Create a newAWS::EC2::EIPAssociation.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.
-
-
Method Details
-
isCfnEIPAssociation
Checks whether the given object is a CfnEIPAssociation.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
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 association. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getEipAssociationRef
A reference to a EIPAssociation resource.- Specified by:
getEipAssociationRefin interfaceIEIPAssociationRef
-
getAllocationId
The allocation ID. -
setAllocationId
The allocation ID. -
getEip
Deprecated.this property has been deprecated -
setEip
Deprecated.this property has been deprecated -
getInstanceId
The ID of the instance. -
setInstanceId
The ID of the instance. -
getNetworkInterfaceId
The ID of the network interface. -
setNetworkInterfaceId
The ID of the network interface. -
getPrivateIpAddress
The primary or secondary private IP address to associate with the Elastic IP address. -
setPrivateIpAddress
The primary or secondary private IP address to associate with the Elastic IP address.
-