eips
Used to retrieve a list of eips
in a region or to create or delete a eips
resource, use eip
to read or update an individual resource.
Overview
Name | eips |
Type | Resource |
Description | Specifies an Elastic IP (EIP) address and can, optionally, associate it with an Amazon EC2 instance.<br/> 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*.<br/> 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*. |
Id | aws.ec2.eips |
Fields
Name | Datatype | Description |
---|---|---|
public_ip | string | |
allocation_id | string | |
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,
public_ip,
allocation_id
FROM aws.ec2.eips
WHERE region = 'us-east-1';
INSERT
Example
Use the following StackQL query and manifest file to create a new eip
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.ec2.eips (
Domain,
NetworkBorderGroup,
TransferAddress,
InstanceId,
PublicIpv4Pool,
Tags,
region
)
SELECT
'{{ Domain }}',
'{{ NetworkBorderGroup }}',
'{{ TransferAddress }}',
'{{ InstanceId }}',
'{{ PublicIpv4Pool }}',
'{{ Tags }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.ec2.eips (
Domain,
NetworkBorderGroup,
TransferAddress,
InstanceId,
PublicIpv4Pool,
Tags,
region
)
SELECT
'{{ Domain }}',
'{{ NetworkBorderGroup }}',
'{{ TransferAddress }}',
'{{ InstanceId }}',
'{{ PublicIpv4Pool }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: eip
props:
- name: Domain
value: '{{ Domain }}'
- name: NetworkBorderGroup
value: '{{ NetworkBorderGroup }}'
- name: TransferAddress
value: '{{ TransferAddress }}'
- name: InstanceId
value: '{{ InstanceId }}'
- name: PublicIpv4Pool
value: '{{ PublicIpv4Pool }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
Example
/*+ delete */
DELETE FROM aws.ec2.eips
WHERE data__Identifier = '<PublicIp|AllocationId>'
AND region = 'us-east-1';
Permissions
To operate on the eips
resource, the following permissions are required:
Create
ec2:AllocateAddress,
ec2:AcceptAddressTransfer,
ec2:DescribeAddresses,
ec2:AssociateAddress,
ec2:CreateTags
Delete
ec2:ReleaseAddress,
ec2:DescribeAddresses,
ec2:DisassociateAddress
List
ec2:DescribeAddresses