03
- 3.3 Elastic Compute Cloud (EC2) virtual instances
- Learning Objectives
- Launch an EC2 instance
- Access your EC2 instance
- Terminate an EC2 instance
3.3 Elastic Compute Cloud (EC2) virtual instances
Learning Objectives
By the end of this lesson you will be able to:
- Launch an EC2 instance.
- Terminate an EC2 instance.
- Assign a security group to an EC2 instance.
- SSH into an EC2 instance.
Launch an EC2 instance
- Go to the EC2 tab on the management console: https://console.aws.amazon.com/ec2/.
- Click the Launch Instance button.
- Click the Continue button from the Classic wizard.
- Click on the Select button for the 64-bit version of the Amazon Linux AMI
- Use the default instance type: t1.micro and click Continue.
- Use the default in “Advanced Instance Options” step and click Continue.
- Enter ssh in the Name tag value and click Continue.
- Select the Create a new Key Pair radio button and enter “ditc” in the “Enter a name for your key pair” field and click the “ Create and Download your Key Pair” link. Save the file onto your computer for future use. Click the Continue button.
- Select the ssh security group that you created in sublesson 3.3 and click the Continue button.
- Click the Launch button.
Access your EC2 instance
Access the instance you previously launched.
- Find the “ditc.pem” file on your computer. If you are are a *nix-based computer, you will need to modify the permissions to 400.
- Select the checkbox next to the instance you launched in the previous set of steps.
- Click on Instance Actions button and select Connect from the menu.
- From the “Connect from your browser using the Java SSH Client (Java Required)” section, enter the fully qualified path in the “Private key path” field where your ditc.pem file is located and click the Launch SSH client button
- Type a few commands from the console.
Terminate an EC2 instance
Terminate an EC2 instance.
- Again, select the checkbox next to the instance you launched in the previous set of steps and click on Instance Actions button and select Terminate from the menu. Then, click the Yes, Terminate button.