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:
- use the browser to access the AWS console.
- go to the EC2>Instances view.
- click the checkbox for the instance, then click the button sequence "Instance state">"Start instance".
- 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.
- go to the "Security" section of the intance information and then click on the one security group listed.
- click on the "Edit inbound rules" button.
- 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:
- launch either the Windows app (iPad) or remote desktop (Windows laptop).
- 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.
- iPad: click and hold the already-defined remote desktop so that you will be enabled to edit it.
- now launch/connect to the remote desktop (tap on it in the case of the iPad).
- when prompted for username and password, use those that were defined when the EC2 instance was originally created.
- 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:
- 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.
- 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