instances
Creates, updates, deletes or gets an instance
resource or lists instances
in a region
Overview
Name | instances |
Type | Resource |
Description | Resource Type definition for AWS::Lightsail::Instance |
Id | aws.lightsail.instances |
Fields
Name | Datatype | Description |
---|---|---|
support_code | string | Support code to help identify any issues |
resource_type | string | Resource type of Lightsail instance. |
is_static_ip | boolean | Is the IP Address of the Instance is the static IP |
private_ip_address | string | Private IP Address of the Instance |
public_ip_address | string | Public IP Address of the Instance |
ipv6_addresses | array | IPv6 addresses of the instance |
location | object | Location of a resource. |
hardware | object | Hardware of the Instance. |
state | object | Current State of the Instance. |
networking | object | Networking of the Instance. |
user_name | string | Username of the Lightsail instance. |
ssh_key_name | string | SSH Key Name of the Lightsail instance. |
instance_name | string | The names to use for your new Lightsail instance. |
availability_zone | string | The 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_id | string | The bundle of specification information for your virtual private server (or instance ), including the pricing plan (e.g., micro_1_0 ). |
blueprint_id | string | The 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_ons | array | An array of objects representing the add-ons to enable for the new instance. |
user_data | string | A 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_name | string | The name of your key pair. |
tags | array | An array of key-value pairs to apply to this resource. |
instance_arn | string | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | InstanceName, BlueprintId, BundleId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.lightsail.instances (
InstanceName,
BundleId,
BlueprintId,
region
)
SELECT
'{{ InstanceName }}',
'{{ BundleId }}',
'{{ BlueprintId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.lightsail.instances (
Location,
Hardware,
State,
Networking,
InstanceName,
AvailabilityZone,
BundleId,
BlueprintId,
AddOns,
UserData,
KeyPairName,
Tags,
region
)
SELECT
'{{ Location }}',
'{{ Hardware }}',
'{{ State }}',
'{{ Networking }}',
'{{ InstanceName }}',
'{{ AvailabilityZone }}',
'{{ BundleId }}',
'{{ BlueprintId }}',
'{{ AddOns }}',
'{{ UserData }}',
'{{ KeyPairName }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: instance
props:
- name: Location
value:
AvailabilityZone: '{{ AvailabilityZone }}'
RegionName: '{{ RegionName }}'
- name: Hardware
value:
CpuCount: '{{ CpuCount }}'
RamSizeInGb: '{{ RamSizeInGb }}'
Disks:
- DiskName: '{{ DiskName }}'
SizeInGb: '{{ SizeInGb }}'
IsSystemDisk: '{{ IsSystemDisk }}'
IOPS: '{{ IOPS }}'
Path: '{{ Path }}'
AttachedTo: '{{ AttachedTo }}'
AttachmentState: '{{ AttachmentState }}'
- name: State
value:
Code: '{{ Code }}'
Name: '{{ Name }}'
- name: Networking
value:
Ports:
- FromPort: '{{ FromPort }}'
ToPort: '{{ ToPort }}'
Protocol: '{{ Protocol }}'
AccessFrom: '{{ AccessFrom }}'
AccessType: '{{ AccessType }}'
CommonName: '{{ CommonName }}'
AccessDirection: '{{ AccessDirection }}'
Ipv6Cidrs:
- '{{ Ipv6Cidrs[0] }}'
CidrListAliases:
- '{{ CidrListAliases[0] }}'
Cidrs:
- '{{ Cidrs[0] }}'
MonthlyTransfer:
GbPerMonthAllocated: '{{ GbPerMonthAllocated }}'
- name: InstanceName
value: '{{ InstanceName }}'
- name: AvailabilityZone
value: '{{ AvailabilityZone }}'
- name: BundleId
value: '{{ BundleId }}'
- name: BlueprintId
value: '{{ BlueprintId }}'
- name: AddOns
value:
- AddOnType: '{{ AddOnType }}'
Status: '{{ Status }}'
AutoSnapshotAddOnRequest:
SnapshotTimeOfDay: '{{ SnapshotTimeOfDay }}'
- name: UserData
value: '{{ UserData }}'
- name: KeyPairName
value: '{{ KeyPairName }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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