Create EC2 Instance

Creating your EC2 Instance

  1. In the AWS Management Console, search for and select EC2 in the search bar.

Create EC2

  1. In the EC2 dashboard:
  • Select Instances from the left navigation pane.
  • Click on the Launch instances button.
  • Under Name and tags, name your instance my-server.

Pro Tip: Use descriptive naming conventions that include environment, project, and purpose (e.g., prod-web-server) to make resource management easier as your infrastructure grows.

Create EC2

Create EC2

Configuring Amazon Machine Image (AMI)

  • Under Application and OS Images (Amazon Machine Image), choose the operating system Amazon Linux.
  • Select Amazon Linux 2023 AMI from the drop-down list.

Amazon Linux 2023 is optimized for AWS and comes pre-installed with many AWS tools, making it a great choice for this lab.

Create EC2

Selecting Instance Type and Authentication

  1. For Instance type, select t3.micro (2 vCPU, 1 GiB memory). This instance type is eligible for the AWS Free Tier.
  2. Under Key pair (login), select Create new key pair.

Security Note: Key pairs are essential for secure SSH access to your instance. Store the private key file securely and never share it. The private key cannot be recovered if lost. Without it, you may lose access to your EC2 instance!

Create EC2

  1. In the Create key pair dialog:
  • Key pair name: fcaj-lab-key
  • Key pair type: RSA
  • Private key file format: .pem (for OpenSSH/Mac/Linux) or .ppk (for PuTTY/Windows). We recommend .pem for this lab.
  • Click Create key pair.

A download dialog box will appear. You need to save this file carefully (e.g., in your Downloads or .ssh folder) as we will use it later to connect to the instance.

Create EC2

Network and Security Configuration

  1. Scroll down to the Network settings section and click the Edit button in the top right corner of the section:
  • VPC: Select fcaj-lab-vpc
  • Subnet: Select the public subnet (e.g., fcaj-public-subnet-1)
  • Auto-assign public IP: Select Enable
  • Firewall (security groups): Choose Select existing security group
  • Common security groups: Choose fcaj-sg-public

Placing EC2 instances in public subnets exposes them directly to the internet. Ensure your security group (fcaj-sg-public) rules are properly configured to allow only necessary inbound traffic (like port 80 for HTTP and port 22 for SSH from your trusted IP).

  1. Finally, review your configurations and click the Launch instance button on the right summary panel.

After successfully launching, you can go to the Instances page and select your newly created instance to view its Public IPv4 address.

Create EC2