Skip to main content

eips

Creates, updates, deletes or gets an eip resource or lists eips in a region

Overview

Nameeips
TypeResource
DescriptionSpecifies 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)](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html) in the *Amazon EC2 User Guide*.
For more information, see [Elastic IP Addresses](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) in the *Amazon EC2 User Guide*.
Idawscc.ec2.eips

Fields

NameDatatypeDescription
public_ipstring
allocation_idstring
domainstringThe network (&#96;&#96;vpc&#96;&#96;).<br />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 &#91;DependsOn Attribute&#93;(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html) on this resource.
network_border_groupstringA 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.<br />Use &#91;DescribeAvailabilityZones&#93;(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API&#95;DescribeAvailabilityZones.html) to view the network border groups.
transfer_addressstringThe Elastic IP address you are accepting for transfer. You can only accept one transferred address. For more information on Elastic IP address transfers, see &#91;Transfer Elastic IP addresses&#93;(https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#transfer-EIPs-intro) in the &#42;Amazon Virtual Private Cloud User Guide&#42;.
instance_idstringThe ID of the instance.<br />Updates to the &#96;&#96;InstanceId&#96;&#96; property may require &#42;some interruptions&#42;. Updates on an EIP reassociates the address on its associated resource.
public_ipv4_poolstringThe ID of an address pool that you own. Use this parameter to let Amazon EC2 select an address from the address pool.<br />Updates to the &#96;&#96;PublicIpv4Pool&#96;&#96; property may require &#42;some interruptions&#42;. Updates on an EIP reassociates the address on its associated resource.
ipam_pool_idstring
addressstring
tagsarrayAny tags assigned to the Elastic IP address.<br />Updates to the &#96;&#96;Tags&#96;&#96; property may require &#42;some interruptions&#42;. Updates on an EIP reassociates the address on its associated resource.
regionstringAWS region.

For more information, see AWS::EC2::EIP.

Methods

NameResourceAccessible byRequired Params
create_resourceeipsINSERTregion
delete_resourceeipsDELETEIdentifier, region
update_resourceeipsUPDATEIdentifier, PatchDocument, region
list_resourceseips_list_onlySELECTregion
get_resourceeipsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual eip.

SELECT
region,
public_ip,
allocation_id,
domain,
network_border_group,
transfer_address,
instance_id,
public_ipv4_pool,
ipam_pool_id,
address,
tags
FROM awscc.ec2.eips
WHERE
region = 'us-east-1' AND
Identifier = '{{ public_ip }}|{{ allocation_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new eip resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.ec2.eips (
Domain,
NetworkBorderGroup,
TransferAddress,
InstanceId,
PublicIpv4Pool,
IpamPoolId,
Address,
Tags,
region
)
SELECT
'{{ domain }}',
'{{ network_border_group }}',
'{{ transfer_address }}',
'{{ instance_id }}',
'{{ public_ipv4_pool }}',
'{{ ipam_pool_id }}',
'{{ address }}',
'{{ tags }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a eip resource, using stack-deploy.

/*+ update */
UPDATE awscc.ec2.eips
SET PatchDocument = string('{{ {
"Domain": domain,
"InstanceId": instance_id,
"PublicIpv4Pool": public_ipv4_pool,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ public_ip }}|{{ allocation_id }}';

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.eips
WHERE
Identifier = '{{ public_ip }}|{{ allocation_id }}' AND
region = 'us-east-1';

Permissions

To operate on the eips resource, the following permissions are required:

ec2:AllocateAddress,
ec2:AcceptAddressTransfer,
ec2:DescribeAddresses,
ec2:AssociateAddress,
ec2:CreateTags