Skip to main content

eip_associations

Creates, updates, deletes or gets an eip_association resource or lists eip_associations in a region

Overview

Nameeip_associations
TypeResource
DescriptionResource schema for EC2 EIP association.
Idaws.ec2.eip_associations

Fields

NameDatatypeDescription
idstringComposite ID of non-empty properties, to determine the identification.
allocation_idstringThe allocation ID. This is required for EC2-VPC.
network_interface_idstringThe ID of the network interface.
instance_idstringThe ID of the instance.
private_ip_addressstringThe primary or secondary private IP address to associate with the Elastic IP address.
e_ipstringThe Elastic IP address to associate with the instance.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTregion
delete_resourceDELETEdata__Identifier, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all eip_associations in a region.

SELECT
region,
id,
allocation_id,
network_interface_id,
instance_id,
private_ip_address,
e_ip
FROM aws.ec2.eip_associations
WHERE region = 'us-east-1';

Gets all properties from an individual eip_association.

SELECT
region,
id,
allocation_id,
network_interface_id,
instance_id,
private_ip_address,
e_ip
FROM aws.ec2.eip_associations
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';

INSERT example

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

/*+ create */
INSERT INTO aws.ec2.eip_associations (
AllocationId,
NetworkInterfaceId,
InstanceId,
PrivateIpAddress,
EIP,
region
)
SELECT
'{{ AllocationId }}',
'{{ NetworkInterfaceId }}',
'{{ InstanceId }}',
'{{ PrivateIpAddress }}',
'{{ EIP }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ec2.eip_associations
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

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

Create

ec2:DescribeAddresses,
ec2:AssociateAddress

Read

ec2:DescribeAddresses

Delete

ec2:DisassociateAddress,
ec2:DescribeAddresses

List

ec2:DescribeAddresses