Skip to main content

static_ips

Creates, updates, deletes, gets or lists a static_ips resource.

Overview

Namestatic_ips
TypeResource
Idaws.lightsail.static_ips

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the static IP (StaticIP-Ohio-EXAMPLE). (pattern: <code>\w[\w-]*\w</code>)
arnstringThe 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_tostringThe instance where the static IP is attached (Amazon_Linux-1GB-Ohio-1). (pattern: <code>\w[\w-]*\w</code>)
created_atstring (date-time)The timestamp when the static IP was created (1479735304.222).
ip_addressstringThe static IP address. (pattern: <code>([0-9]{1,3}.){3}[0-9]{1,3}</code>)
is_attachedbooleanA Boolean value indicating whether the static IP is attached.
locationobjectDescribes the resource location.
resource_typestringThe 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_codestringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
get_static_ipselectregionReturns information about an Amazon Lightsail static IP.
get_static_ipsselectregionReturns information about all static IPs in the user's account.
attach_static_ipupdateregion, staticIpName, instanceNameAttaches a static IP address to a specific Amazon Lightsail instance.
allocate_static_ipupdateregion, staticIpNameAllocates a static IP address.
detach_static_ipexecregion, staticIpNameDetaches a static IP from the Amazon Lightsail instance to which it is attached.
release_static_ipexecregion, staticIpNameDeletes 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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
;

UPDATE examples

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;

Lifecycle Methods

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 }}"
}'
;