Basic EC2 instance use pattern#

Prerequisites#

This use pattern is predicated on the following elements having already been put in place:

  • You have established your own AWS account
    • A credit card payment method has been set up in the account so that the small charges incurred will be auto-payed each month
  • An EC2 Instance (virtual machine) has been created in the AWS account with the following properties:
    • Instance type: t2.medium
    • AMI type: Ubuntu
    • Storage type: EBS gp3, 24GIB
    • Ubuntu customization:
      • lubuntu-desktop
      • xrdp
      • Chromium browser via snap
  • You have installed the Windows app on your computer or iPad to enable RDP-based remote access
    • A remote desktop definition has been defined in the app

The pattern#

On your computer or iPad, do the following.

To bring the virtual machine online and commence a working session:

  • AWS console steps via browser:
    1. use the browser to access the AWS console.
    2. go to the EC2>Instances view.
    3. click the checkbox for the instance, then click the button sequence "Instance state">"Start instance".
    4. wait for the instance to show it is running and then copy the "Public IPv4 address" from the instance details and paste it in a notepad page for later use.
    5. go to the "Security" section of the intance information and then click on the one security group listed.
    6. click on the "Edit inbound rules" button.
    7. Find the rule allowing type "RDP" and in the "Source" section, use the "x" to delete the current IP address. Now use the "Source type" selector to choose "My IP"; this will enter your current IP address into the Source input field, after which you should click "Save ruies".
  • Using Windows App (iPad) -or- remote desktop/mstsc (Windows laptop) to remote to the virtual machine:
    1. launch either the Windows app (iPad) or remote desktop (Windows laptop).
    2. update the previously-created remote connection definition with the instance's new IPv4 address:
      • iPad: click and hold the already-defined remote desktop so that you will be enabled to edit it.
        • change the current "Name" to the IP address obtained in step 4 and save the change.
      • Windows laptop: in the Remote Desktop Connection "Computer" field, paste the "Public IPv4 address" that you saved after starting up the EC2 instance.
    3. now launch/connect to the remote desktop (tap on it in the case of the iPad).
    4. when prompted for username and password, use those that were defined when the EC2 instance was originally created.
    5. you should now be ready to proceed with a standard working session to accomplish your tasks.

To close things down when you have completed your working session:

  1. in the Windows app remote session, click the "QTerminal" icon (has ">_" graphic) in the Quick Launch bar (bottom of left side of desktop)
    • in QTerminal, type the command "sudo shutdown now" and then hit the return/enter key.
    • the remote session should end abruptly due to the virtual machine shutting down.
  2. in the AWS EC2>Instances view, periodically click the "Refresh Instances" icon until you observe the "Instance state" change to "Stopped".

That's it. With the EC2 instance stopped, you have reduced the pay-as-you-go resources in use to just the virtual machine's persistent EBS virtual disk. The instance will remain in the stopped state until you repeat this process to begin a future working session.

Video demo of the above process#

Launch a recorded demo of the above steps for further reference >>


Leave a comment
Submissions are subject to review and approval