@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:42.393Z") public class CfnEIP extends CfnResource implements IInspectable
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 .
[EC2-VPC] If you release an Elastic IP address, you might be able to recover it. You cannot recover an Elastic IP address that you released after it is allocated to another AWS account. You cannot recover an Elastic IP address for EC2-Classic. To attempt to recover an Elastic IP address that you released, specify it in this operation.
An Elastic IP address is for use either in the EC2-Classic platform or in a VPC. By default, you can allocate 5 Elastic IP addresses for EC2-Classic per Region and 5 Elastic IP addresses for EC2-VPC per Region.
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();
Modifier and Type | Class and Description |
---|---|
static class |
CfnEIP.Builder
A fluent builder for
CfnEIP . |
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 |
---|---|
|
CfnEIP(Construct scope,
java.lang.String id)
Create a new `AWS::EC2::EIP`.
|
|
CfnEIP(Construct scope,
java.lang.String id,
CfnEIPProps props)
Create a new `AWS::EC2::EIP`.
|
protected |
CfnEIP(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnEIP(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttrAllocationId()
The ID that AWS assigns to represent the allocation of the address for use with Amazon VPC.
|
java.lang.String |
getAttrPublicIp()
The Elastic IP address.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getDomain()
Indicates whether the Elastic IP address is for use with instances in a VPC or instance in EC2-Classic.
|
java.lang.String |
getInstanceId()
The ID of the instance.
|
java.lang.String |
getNetworkBorderGroup()
A unique set of Availability Zones, Local Zones, or Wavelength Zones from which AWS advertises IP addresses.
|
java.lang.String |
getPublicIpv4Pool()
The ID of an address pool that you own.
|
TagManager |
getTags()
Any tags assigned to the Elastic IP address.
|
java.lang.String |
getTransferAddress()
The Elastic IP address you are accepting for transfer.
|
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 |
setDomain(java.lang.String value)
Indicates whether the Elastic IP address is for use with instances in a VPC or instance in EC2-Classic.
|
void |
setInstanceId(java.lang.String value)
The ID of the instance.
|
void |
setNetworkBorderGroup(java.lang.String value)
A unique set of Availability Zones, Local Zones, or Wavelength Zones from which AWS advertises IP addresses.
|
void |
setPublicIpv4Pool(java.lang.String value)
The ID of an address pool that you own.
|
void |
setTransferAddress(java.lang.String value)
The Elastic IP address you are accepting for transfer.
|
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 CfnEIP(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnEIP(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnEIP(Construct scope, java.lang.String id, CfnEIPProps 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.public CfnEIP(Construct scope, java.lang.String id)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. 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 getAttrAllocationId()
This is returned only for VPC elastic IP addresses. For example, eipalloc-5723d13e
.
public java.lang.String getAttrPublicIp()
protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public TagManager getTags()
Updates to the
Tags
property may require some interruptions . Updates on an EIP reassociates the address on its associated resource.
public java.lang.String getDomain()
Default: If the Region supports EC2-Classic, the default is standard
. Otherwise, the default is vpc
.
Use when allocating an address for use with a VPC if the Region supports EC2-Classic.
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.
public void setDomain(java.lang.String value)
Default: If the Region supports EC2-Classic, the default is standard
. Otherwise, the default is vpc
.
Use when allocating an address for use with a VPC if the Region supports EC2-Classic.
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.
public java.lang.String getInstanceId()
Updates to the
InstanceId
property may require some interruptions . Updates on an EIP reassociates the address on its associated resource.
public void setInstanceId(java.lang.String value)
Updates to the
InstanceId
property may require some interruptions . Updates on an EIP reassociates the address on its associated resource.
public java.lang.String getNetworkBorderGroup()
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.
public void setNetworkBorderGroup(java.lang.String value)
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.
public java.lang.String getPublicIpv4Pool()
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.
public void setPublicIpv4Pool(java.lang.String value)
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.
public java.lang.String getTransferAddress()
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 .
public void setTransferAddress(java.lang.String value)
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 .