Skip to main content

AWS Lightsail: Notes

AWS Lighsail Logo

One of ways to learn AWS is start with https://aws.amazon.com/lightsail/, first month is free.

List of services on AWS Lightsail:

  • Instances
  • Containers
  • Databases
  • Networking
  • Storage
  • Snapshots
AWS Lightsail services

Databases

aws lightsail get-relational-database --relational-database-name dbname-here --profile profile-here

PS F:\Projects\github\spring-jpa-h2> F:\xampp\mysql\bin\mysql.exe -u dbmasteruser -h ls-01873f09d6081824bab0192b883ef5308f7e2d73.ckcgqkvrumsn.us-east-1.rds.amazonaws.com -p
Enter password: ********************************
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 6065
Server version: 8.0.23 Source distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| dbmaster           |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.375 sec)

MySQL [(none)]>

Setup AWS Lightsail Instance for Cloud9

sudo apt install nodejs npm -y
aws lightsail get-instance --instance-name instancename-here --profile profile-here
PS C:\Users\tuyen> aws lightsail delete-instance --instance-name WordPress_Multisite-1 --profile PROFILE-NAME-HERE --region ap-southeast-2
{
    "operations": [
        {
            "id": "448a6332-1cdd-4151-ad70-eb5c8a1acac6",
            "resourceName": "4e17d509-b746-4a41-91b6-04c63467e470",
            "resourceType": "Alarm",
            "createdAt": "2023-11-08T21:57:57.967000+07:00",
            "location": {
                "availabilityZone": "all",
                "regionName": "ap-southeast-2"
            },
            "isTerminal": true,
            "operationDetails": "WordPress_Multisite-1",
            "operationType": "DeleteAlarm",
            "status": "Succeeded",
            "statusChangedAt": "2023-11-08T21:57:57.967000+07:00"
        },
        {
            "id": "5cc7c719-b605-4bf7-80d1-caf780aae459",
            "resourceName": "WordPress_Multisite-1",
            "resourceType": "Instance",
            "createdAt": "2023-11-08T21:57:58.450000+07:00",
            "location": {
                "availabilityZone": "ap-southeast-2a",
                "regionName": "ap-southeast-2"
            },
            "isTerminal": true,
            "operationDetails": "",
            "operationType": "DeleteInstance",
            "status": "Succeeded",
            "statusChangedAt": "2023-11-08T21:57:58.450000+07:00"
        }
    ]
}

PS C:\Users\tuyen>
PS C:\Users\tuyen> aws lightsail delete-instance --instance-name Ghost-1 --profile PROFILE-NAME-HERE
{
    "operations": [
        {
            "id": "f0838a18-8c81-441f-bddf-07e2e0f8f0d5",
            "resourceName": "Ghost-1",
            "resourceType": "Instance",
            "createdAt": "2024-09-23T11:18:42.894000+07:00",
            "location": {
                "availabilityZone": "us-east-1a",
                "regionName": "us-east-1"
            },
            "isTerminal": true,
            "operationDetails": "",
            "operationType": "DeleteInstance",
            "status": "Succeeded",
            "statusChangedAt": "2024-09-23T11:18:42.894000+07:00"
        }
    ]
}

PS C:\Users\tuyen>

PS C:\Users\tuyen> aws lightsail get-relational-databases --region us-east-1 --profile PROFILE-NAME-HERE
PS C:\Users\tuyen> aws lightsail delete-relational-database --relational-database-name RELATIONAL-DB-NAME-HERE --region us-east-1 --profile PROFILE-NAME-HERE

Popular posts from this blog

Delete files older than 365 days

I must delete IIS *.log files in  older than 365 days. D:\Logs | -W3SVC1 -W3SVC2 -... -W3SVC33 daily-delete-logfiles-older-than-365-days.cmd :: Daily delete log files older than 365 days :: Created on: 20161120 :: Created by: :: Last modified on: :: Last modified by: :: History: SET DIRLOG=E:\_scripts\Logs\ :: Echo @path to test first :: FORFILES /P D:\Logs /S /M *.log /D -365 /C "cmd /c echo @path @fdate" :: Delete files ECHO "Begin" >> %dirlog%daily-delete-logfiles.log DATE /T >> %dirlog%daily-delete-logfiles.log TIME /T >> %dirlog%daily-delete-logfiles.log FORFILES /P D:\Logs /S /M *.log /D -365 /C "cmd /c del @path" >> %dirlog%daily-delete-logfiles.log ECHO "Finished" >> %dirlog%daily-delete-logfiles.log DATE /T >> %dirlog%daily-delete-logfiles.log TIME /T >> %dirlog%daily-delete-logfiles.log :: END of script /P : Path to folder /S: recurse into subdirectories /M *.l...

Ping group on Windows with FOR command

Notes from daily work situation.

Powershell: Test-NetConnection

PS C:\Users\tuyen> get-help Test-NetConnection NAME     Test-NetConnection SYNTAX     Test-NetConnection [[-ComputerName] <string>] [-TraceRoute] [-Hops <int>] [-InformationLevel {Quiet |     Detailed}]  [<CommonParameters>]     Test-NetConnection [[-ComputerName] <string>] [-CommonTCPPort] {HTTP | RDP | SMB | WINRM}     [-InformationLevel {Quiet | Detailed}]  [<CommonParameters>]     Test-NetConnection [[-ComputerName] <string>] -Port <int> [-InformationLevel {Quiet | Detailed}]     [<CommonParameters>]     Test-NetConnection [[-ComputerName] <string>] -DiagnoseRouting [-ConstrainSourceAddress <string>]     [-ConstrainInterface <uint32>] [-InformationLevel {Quiet | Detailed}]  [<CommonParameters>] ALIASES     TNC REMARKS     Get-Help cannot find the Help files fo...