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
DescriptionAssociates 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](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-eips.html#vpc-eip-overview).
You must specify ``AllocationId`` and either ``InstanceId``, ``NetworkInterfaceId``, or ``PrivateIpAddress``.
Idawscc.ec2.eip_associations

Fields

NameDatatypeDescription
private_ip_addressstringThe 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.
instance_idstringThe 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.
allocation_idstringThe allocation ID. This is required.
idstring
network_interface_idstringThe ID of the network interface. If the instance has more than one network interface, you must specify a network interface ID.<br />You can specify either the instance ID or the network interface ID, but not both.
e_ipstring
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourceeip_associationsINSERTregion
delete_resourceeip_associationsDELETEIdentifier, region
list_resourceseip_associations_list_onlySELECTregion
get_resourceeip_associationsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual eip_association.

SELECT
region,
private_ip_address,
instance_id,
allocation_id,
id,
network_interface_id,
e_ip
FROM awscc.ec2.eip_associations
WHERE
region = 'us-east-1' AND
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 awscc.ec2.eip_associations (
PrivateIpAddress,
InstanceId,
AllocationId,
NetworkInterfaceId,
EIP,
region
)
SELECT
'{{ private_ip_address }}',
'{{ instance_id }}',
'{{ allocation_id }}',
'{{ network_interface_id }}',
'{{ e_ip }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM awscc.ec2.eip_associations
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';

Permissions

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

ec2:DescribeAddresses