Class CfnEIPAssociation

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:38.550Z") @Stability(Stable) public class CfnEIPAssociation extends CfnResource implements IInspectable
A CloudFormation AWS::EC2::EIPAssociation.

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();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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 Construct scope, @NotNull String id, @Nullable CfnEIPAssociationProps props)
      Create a new AWS::EC2::EIPAssociation.

      Parameters:
      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.
    • CfnEIPAssociation

      @Stability(Stable) public CfnEIPAssociation(@NotNull Construct scope, @NotNull String id)
      Create a new AWS::EC2::EIPAssociation.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getAllocationId

      @Stability(Stable) @Nullable public String getAllocationId()
      The allocation ID.

      This is required.

    • setAllocationId

      @Stability(Stable) public void setAllocationId(@Nullable String value)
      The allocation ID.

      This is required.

    • getEip

      @Stability(Stable) @Nullable public String getEip()
      Deprecated.
    • setEip

      @Stability(Stable) public void setEip(@Nullable String value)
      Deprecated.
    • getInstanceId

      @Stability(Stable) @Nullable public String getInstanceId()
      The ID of the instance.

      The instance must have exactly one attached network interface. You can specify either the instance ID or the network interface ID, but not both.

    • setInstanceId

      @Stability(Stable) public void setInstanceId(@Nullable String value)
      The ID of the instance.

      The instance must have exactly one attached network interface. You can specify either the instance ID or the network interface ID, but not both.

    • getNetworkInterfaceId

      @Stability(Stable) @Nullable public String getNetworkInterfaceId()
      The ID of the network interface.

      If the instance has more than one network interface, you must specify a network interface ID.

      You can specify either the instance ID or the network interface ID, but not both.

    • setNetworkInterfaceId

      @Stability(Stable) public void setNetworkInterfaceId(@Nullable String value)
      The ID of the network interface.

      If the instance has more than one network interface, you must specify a network interface ID.

      You can specify either the instance ID or the network interface ID, but not both.

    • getPrivateIpAddress

      @Stability(Stable) @Nullable public String getPrivateIpAddress()
      The primary or secondary private IP address to associate with the Elastic IP address.

      If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.

    • setPrivateIpAddress

      @Stability(Stable) public void setPrivateIpAddress(@Nullable String value)
      The primary or secondary private IP address to associate with the Elastic IP address.

      If no private IP address is specified, the Elastic IP address is associated with the primary private IP address.