Skip to main content

instances

Creates, updates, deletes or gets an instance resource or lists instances in a region

Overview

Nameinstances
TypeResource
DescriptionResource Type definition for AWS::Lightsail::Instance
Idaws.lightsail.instances

Fields

NameDatatypeDescription
support_codestringSupport code to help identify any issues
resource_typestringResource type of Lightsail instance.
is_static_ipbooleanIs the IP Address of the Instance is the static IP
private_ip_addressstringPrivate IP Address of the Instance
public_ip_addressstringPublic IP Address of the Instance
ipv6_addressesarrayIPv6 addresses of the instance
locationobjectLocation of a resource.
hardwareobjectHardware of the Instance.
stateobjectCurrent State of the Instance.
networkingobjectNetworking of the Instance.
user_namestringUsername of the Lightsail instance.
ssh_key_namestringSSH Key Name of the Lightsail instance.
instance_namestringThe names to use for your new Lightsail instance.
availability_zonestringThe Availability Zone in which to create your instance. Use the following format: us-east-2a (case sensitive). Be sure to add the include Availability Zones parameter to your request.
bundle_idstringThe bundle of specification information for your virtual private server (or instance ), including the pricing plan (e.g., micro_1_0 ).
blueprint_idstringThe ID for a virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0 ). Use the get blueprints operation to return a list of available images (or blueprints ).
add_onsarrayAn array of objects representing the add-ons to enable for the new instance.
user_datastringA launch script you can create that configures a server with additional user data. For example, you might want to run apt-get -y update.
key_pair_namestringThe name of your key pair.
tagsarrayAn array of key-value pairs to apply to this resource.
instance_arnstring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTInstanceName, BlueprintId, BundleId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all instances in a region.

SELECT
region,
support_code,
resource_type,
is_static_ip,
private_ip_address,
public_ip_address,
ipv6_addresses,
location,
hardware,
state,
networking,
user_name,
ssh_key_name,
instance_name,
availability_zone,
bundle_id,
blueprint_id,
add_ons,
user_data,
key_pair_name,
tags,
instance_arn
FROM aws.lightsail.instances
WHERE region = 'us-east-1';

Gets all properties from an individual instance.

SELECT
region,
support_code,
resource_type,
is_static_ip,
private_ip_address,
public_ip_address,
ipv6_addresses,
location,
hardware,
state,
networking,
user_name,
ssh_key_name,
instance_name,
availability_zone,
bundle_id,
blueprint_id,
add_ons,
user_data,
key_pair_name,
tags,
instance_arn
FROM aws.lightsail.instances
WHERE region = 'us-east-1' AND data__Identifier = '<InstanceName>';

INSERT example

Use the following StackQL query and manifest file to create a new instance resource, using stack-deploy.

/*+ create */
INSERT INTO aws.lightsail.instances (
InstanceName,
BundleId,
BlueprintId,
region
)
SELECT
'{{ InstanceName }}',
'{{ BundleId }}',
'{{ BlueprintId }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.lightsail.instances
WHERE data__Identifier = '<InstanceName>'
AND region = 'us-east-1';

Permissions

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

Create

lightsail:CreateInstances,
lightsail:GetInstances,
lightsail:EnableAddOn,
lightsail:GetInstance,
lightsail:DisableAddOn,
lightsail:PutInstancePublicPorts,
lightsail:AttachDisk,
lightsail:DetachDisk,
lightsail:StartInstance,
lightsail:StopInstance,
lightsail:GetDisk,
lightsail:GetRegions,
lightsail:TagResource,
lightsail:UntagResource

Read

lightsail:GetInstances,
lightsail:GetInstance

Delete

lightsail:GetInstances,
lightsail:GetInstance,
lightsail:DeleteInstance

List

lightsail:GetInstances

Update

lightsail:GetInstances,
lightsail:GetInstance,
lightsail:DeleteInstance,
lightsail:EnableAddOn,
lightsail:DisableAddOn,
lightsail:PutInstancePublicPorts,
lightsail:AttachDisk,
lightsail:DetachDisk,
lightsail:StartInstance,
lightsail:StopInstance,
lightsail:GetDisk,
lightsail:TagResource,
lightsail:UntagResource