title: How do I get the instance name of a Lightsail instance
body: <p>How do I find the name of "this" Lightsail instance. "This" being the instance that the aws command is being executed. My below script isn't working, since I thought Lightsail is just another EC2 instance.</p>
  
  <pre><code>#!/bin/bash
  InstanceId=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
  echo $InstanceId
  
  Region=`aws configure get region`
  echo $Region
  
  InstanceName=$(aws ec2 describe-tags --region $Region --filters "Name=resource-id,Values=$InstanceId" "Name=key,Values=Name" --output text | cut -f5)
  echo $InstanceName 
  </code></pre>