DEV Community

Cover image for Day 21.Setting Up an EC2 Instance with an Elastic IP for Application Hosting
Thu Kha Kyawe
Thu Kha Kyawe

Posted on

Day 21.Setting Up an EC2 Instance with an Elastic IP for Application Hosting

Lab Information

The Nautilus DevOps Team has received a new request from the Development Team to set up a new EC2 instance. This instance will be used to host a new application that requires a stable IP address. To ensure that the instance has a consistent public IP, an Elastic IP address needs to be associated with it. The instance will be named xfusion-ec2, and the Elastic IP will be named xfusion-eip. This setup will help the Development Team to have a reliable and consistent access point for their application.

Create an EC2 instance named xfusion-ec2 using any linux AMI like ubuntu, the Instance type must be t2.micro and associate an Elastic IP address with this instance, name it as xfusion-eip.

Lab Solutions

Step-by-Step Instructions (AWS Console)

  1. Log in to AWS Console

Use your lab credentials and confirm the region is us-east-1 (N. Virginia).

  1. Launch the EC2 Instance 2.1 Open EC2

Search for EC2 → click Launch instance

2.2 Name the Instance

Under Name and tags:

Name: xfusion-ec2

2.3 Choose Linux AMI

Under Application and OS Images (AMI), select any Linux AMI, for example:

Ubuntu Server 20.04 LTS or Ubuntu Server 22.04 LTS

2.4 Choose Instance Type

Select t2.micro

2.5 Key Pair

Choose an existing key pair or create a new one (lab usually allows either)

2.6 Network Settings

Use default VPC

Use default security group

Ensure Auto-assign public IP is Enabled (EIP will replace it later)

2.7 Launch

Click Launch instance
Wait until the instance state becomes Running and status checks pass (2/2).

  1. Allocate an Elastic IP 3.1 Navigate to Elastic IPs

EC2 → Network & Security → Elastic IPs

3.2 Allocate Elastic IP

Click Allocate Elastic IP address

Leave defaults

Click Allocate

3.3 Name the Elastic IP

Select the newly created Elastic IP

Go to Tags → Manage tags

Add:

Key: Name

Value: xfusion-eip

Save

  1. Associate Elastic IP with EC2 Instance

Select xfusion-eip

Click Actions → Associate Elastic IP address

Set:

Resource type: Instance

Instance: xfusion-ec2

Private IP: Default

Click Associate

  1. Verify Configuration EC2 Instance

Public IPv4 address = Elastic IP

Instance name = xfusion-ec2

State = Running

Elastic IP

Name = xfusion-eip

Status = Associated

Instance = xfusion-ec2


Resources & Next Steps
📦 Full Code Repository: KodeKloud Learning Labs
📖 More Deep Dives: Whispering Cloud Insights - Read other technical articles
💬 Join Discussion: DEV Community - Share your thoughts and questions
💼 Let's Connect: LinkedIn - I'd love to connect with you

Credits
• All labs are from: KodeKloud
• I sincerely appreciate your provision of these valuable resources.

Top comments (0)