Class CfnEIP

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.548Z") @Stability(Stable) public class CfnEIP extends CfnResource implements IInspectable
A CloudFormation AWS::EC2::EIP.

Specifies an Elastic IP (EIP) address and can, optionally, associate it with an Amazon EC2 instance.

You can allocate an Elastic IP address from an address pool owned by AWS or from an address pool created from a public IPv4 address range that you have brought to AWS for use with your AWS resources using bring your own IP addresses (BYOIP). For more information, see Bring Your Own IP Addresses (BYOIP) in the Amazon EC2 User Guide .

For more information, see Elastic IP Addresses in the Amazon EC2 User Guide .

Example:

 Instance instance;
 HostedZone myZone;
 CfnEIP elasticIp = CfnEIP.Builder.create(this, "EIP")
         .domain("vpc")
         .instanceId(instance.getInstanceId())
         .build();
 ARecord.Builder.create(this, "ARecord")
         .zone(myZone)
         .target(RecordTarget.fromIpAddresses(elasticIp.getRef()))
         .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

    • CfnEIP

      protected CfnEIP(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnEIP

      protected CfnEIP(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnEIP

      @Stability(Stable) public CfnEIP(@NotNull Construct scope, @NotNull String id, @Nullable CfnEIPProps props)
      Create a new AWS::EC2::EIP.

      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.
    • CfnEIP

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

      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.
    • getAttrAllocationId

      @Stability(Stable) @NotNull public String getAttrAllocationId()
      The ID that AWS assigns to represent the allocation of the address for use with Amazon VPC.

      This is returned only for VPC elastic IP addresses. For example, eipalloc-5723d13e .

    • getAttrPublicIp

      @Stability(Stable) @NotNull public String getAttrPublicIp()
      The Elastic IP address.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      Any tags assigned to the Elastic IP address.

      Updates to the Tags property may require some interruptions . Updates on an EIP reassociates the address on its associated resource.

    • getDomain

      @Stability(Stable) @Nullable public String getDomain()
      The network ( vpc ).

      If you define an Elastic IP address and associate it with a VPC that is defined in the same template, you must declare a dependency on the VPC-gateway attachment by using the DependsOn Attribute on this resource.

    • setDomain

      @Stability(Stable) public void setDomain(@Nullable String value)
      The network ( vpc ).

      If you define an Elastic IP address and associate it with a VPC that is defined in the same template, you must declare a dependency on the VPC-gateway attachment by using the DependsOn Attribute on this resource.

    • getInstanceId

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

      Updates to the InstanceId property may require some interruptions . Updates on an EIP reassociates the address on its associated resource.

    • setInstanceId

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

      Updates to the InstanceId property may require some interruptions . Updates on an EIP reassociates the address on its associated resource.

    • getNetworkBorderGroup

      @Stability(Stable) @Nullable public String getNetworkBorderGroup()
      A unique set of Availability Zones, Local Zones, or Wavelength Zones from which AWS advertises IP addresses.

      Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups.

      Use DescribeAvailabilityZones to view the network border groups.

      You cannot use a network border group with EC2 Classic. If you attempt this operation on EC2 Classic, you receive an InvalidParameterCombination error.

    • setNetworkBorderGroup

      @Stability(Stable) public void setNetworkBorderGroup(@Nullable String value)
      A unique set of Availability Zones, Local Zones, or Wavelength Zones from which AWS advertises IP addresses.

      Use this parameter to limit the IP address to this location. IP addresses cannot move between network border groups.

      Use DescribeAvailabilityZones to view the network border groups.

      You cannot use a network border group with EC2 Classic. If you attempt this operation on EC2 Classic, you receive an InvalidParameterCombination error.

    • getPublicIpv4Pool

      @Stability(Stable) @Nullable public String getPublicIpv4Pool()
      The ID of an address pool that you own.

      Use this parameter to let Amazon EC2 select an address from the address pool.

      Updates to the PublicIpv4Pool property may require some interruptions . Updates on an EIP reassociates the address on its associated resource.

    • setPublicIpv4Pool

      @Stability(Stable) public void setPublicIpv4Pool(@Nullable String value)
      The ID of an address pool that you own.

      Use this parameter to let Amazon EC2 select an address from the address pool.

      Updates to the PublicIpv4Pool property may require some interruptions . Updates on an EIP reassociates the address on its associated resource.

    • getTransferAddress

      @Stability(Stable) @Nullable public String getTransferAddress()
      The Elastic IP address you are accepting for transfer.

      You can only accept one transferred address. For more information on Elastic IP address transfers, see Transfer Elastic IP addresses in the Amazon Virtual Private Cloud User Guide .

    • setTransferAddress

      @Stability(Stable) public void setTransferAddress(@Nullable String value)
      The Elastic IP address you are accepting for transfer.

      You can only accept one transferred address. For more information on Elastic IP address transfers, see Transfer Elastic IP addresses in the Amazon Virtual Private Cloud User Guide .