static_ips
Creates, updates, deletes, gets or lists a static_ips resource.
Overview
| Name | static_ips |
| Type | Resource |
| Id | aws.lightsail.static_ips |
Fields
The following fields are returned by SELECT queries:
- get_static_ip
- get_static_ips
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the static IP (StaticIP-Ohio-EXAMPLE). (pattern: <code>\w[\w-]*\w</code>) |
arn | string | The Amazon Resource Name (ARN) of the static IP (arn:aws:lightsail:us-east-2:123456789101:StaticIp/9cbb4a9e-f8e3-4dfe-b57e-12345EXAMPLE). (pattern: <code>.\S.</code>) |
attached_to | string | The instance where the static IP is attached (Amazon_Linux-1GB-Ohio-1). (pattern: <code>\w[\w-]*\w</code>) |
created_at | string (date-time) | The timestamp when the static IP was created (1479735304.222). |
ip_address | string | The static IP address. (pattern: <code>([0-9]{1,3}.){3}[0-9]{1,3}</code>) |
is_attached | boolean | A Boolean value indicating whether the static IP is attached. |
location | object | Describes the resource location. |
resource_type | string | The resource type (usually StaticIp). (ContainerService, Instance, StaticIp, KeyPair, InstanceSnapshot, Domain, PeeredVpc, LoadBalancer, LoadBalancerTlsCertificate, Disk, DiskSnapshot, RelationalDatabase, RelationalDatabaseSnapshot, ExportSnapshotRecord, CloudFormationStackRecord, Alarm, ContactMethod, Distribution, Certificate, Bucket) |
support_code | string | The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the static IP (StaticIP-Ohio-EXAMPLE). (pattern: <code>\w[\w-]*\w</code>) |
arn | string | The Amazon Resource Name (ARN) of the static IP (arn:aws:lightsail:us-east-2:123456789101:StaticIp/9cbb4a9e-f8e3-4dfe-b57e-12345EXAMPLE). (pattern: <code>.\S.</code>) |
attached_to | string | The instance where the static IP is attached (Amazon_Linux-1GB-Ohio-1). (pattern: <code>\w[\w-]*\w</code>) |
created_at | string (date-time) | The timestamp when the static IP was created (1479735304.222). |
ip_address | string | The static IP address. (pattern: <code>([0-9]{1,3}.){3}[0-9]{1,3}</code>) |
is_attached | boolean | A Boolean value indicating whether the static IP is attached. |
location | object | Describes the resource location. |
resource_type | string | The resource type (usually StaticIp). (ContainerService, Instance, StaticIp, KeyPair, InstanceSnapshot, Domain, PeeredVpc, LoadBalancer, LoadBalancerTlsCertificate, Disk, DiskSnapshot, RelationalDatabase, RelationalDatabaseSnapshot, ExportSnapshotRecord, CloudFormationStackRecord, Alarm, ContactMethod, Distribution, Certificate, Bucket) |
support_code | string | The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_static_ip | select | region | Returns information about an Amazon Lightsail static IP. | |
get_static_ips | select | region | Returns information about all static IPs in the user's account. | |
attach_static_ip | update | region, staticIpName, instanceName | Attaches a static IP address to a specific Amazon Lightsail instance. | |
allocate_static_ip | update | region, staticIpName | Allocates a static IP address. | |
detach_static_ip | exec | region, staticIpName | Detaches a static IP from the Amazon Lightsail instance to which it is attached. | |
release_static_ip | exec | region, staticIpName | Deletes a specific static IP from your account. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_static_ip
- get_static_ips
Returns information about an Amazon Lightsail static IP.
SELECT
name,
arn,
attached_to,
created_at,
ip_address,
is_attached,
location,
resource_type,
support_code
FROM aws.lightsail.static_ips
WHERE region = '{{ region }}' -- required
;
Returns information about all static IPs in the user's account.
SELECT
name,
arn,
attached_to,
created_at,
ip_address,
is_attached,
location,
resource_type,
support_code
FROM aws.lightsail.static_ips
WHERE region = '{{ region }}' -- required
;
UPDATE examples
- attach_static_ip
- allocate_static_ip
Attaches a static IP address to a specific Amazon Lightsail instance.
UPDATE aws.lightsail.static_ips
SET
staticIpName = '{{ staticIpName }}',
instanceName = '{{ instanceName }}'
WHERE
region = '{{ region }}' --required
AND staticIpName = '{{ staticIpName }}' --required
AND instanceName = '{{ instanceName }}' --required
RETURNING
operations;
Allocates a static IP address.
UPDATE aws.lightsail.static_ips
SET
staticIpName = '{{ staticIpName }}'
WHERE
region = '{{ region }}' --required
AND staticIpName = '{{ staticIpName }}' --required
RETURNING
operations;
Lifecycle Methods
- detach_static_ip
- release_static_ip
Detaches a static IP from the Amazon Lightsail instance to which it is attached.
EXEC aws.lightsail.static_ips.detach_static_ip
@region='{{ region }}' --required
@@json=
'{
"staticIpName": "{{ staticIpName }}"
}'
;
Deletes a specific static IP from your account.
EXEC aws.lightsail.static_ips.release_static_ip
@region='{{ region }}' --required
@@json=
'{
"staticIpName": "{{ staticIpName }}"
}'
;