eip_associations
Used to retrieve a list of eip_associations
in a region or to create or delete a eip_associations
resource, use eip_association
to read or update an individual resource.
Overview
Name | eip_associations |
Type | Resource |
Description | Resource schema for EC2 EIP association. |
Id | aws.ec2.eip_associations |
Fields
Name | Datatype | Description |
---|---|---|
id | string | Composite ID of non-empty properties, to determine the identification. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | region |
delete_resource | DELETE | data__Identifier, region |
list_resource | SELECT | region |
SELECT
Example
SELECT
region,
id
FROM aws.ec2.eip_associations
WHERE region = 'us-east-1';
INSERT
Example
Use the following StackQL query and manifest file to create a new eip_association
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.eip_associations (
AllocationId,
NetworkInterfaceId,
InstanceId,
PrivateIpAddress,
EIP,
region
)
SELECT
'{{ AllocationId }}',
'{{ NetworkInterfaceId }}',
'{{ InstanceId }}',
'{{ PrivateIpAddress }}',
'{{ EIP }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.eip_associations (
AllocationId,
NetworkInterfaceId,
InstanceId,
PrivateIpAddress,
EIP,
region
)
SELECT
'{{ AllocationId }}',
'{{ NetworkInterfaceId }}',
'{{ InstanceId }}',
'{{ PrivateIpAddress }}',
'{{ EIP }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: eip_association
props:
- name: AllocationId
value: '{{ AllocationId }}'
- name: NetworkInterfaceId
value: '{{ NetworkInterfaceId }}'
- name: InstanceId
value: '{{ InstanceId }}'
- name: PrivateIpAddress
value: '{{ PrivateIpAddress }}'
- name: EIP
value: '{{ EIP }}'
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
Delete
ec2:DisassociateAddress,
ec2:DescribeAddresses
List
ec2:DescribeAddresses