24 C
Dubai
Friday, November 22, 2024

Prepare AWS EC2 for Java Spring Boot Application and CodeDeploy

This article provides a step-by-step guide on preparing an AWS EC2 instance for running a Java Spring Boot application with CodeDeploy. The process includes executing the following commands in PowerShell:

  1. Updating the EC2 instance with the latest packages using the command sudo yum update.
  2. Installing the Amazon Corretto 17 JDK in headless mode for Java application support with sudo yum install java-17-amazon-corretto-headless.x86_64 -y.
  3. Installing Ruby as a prerequisite for CodeDeploy using the command sudo yum install ruby -y.
  4. Navigating to the /home/ec2-user directory with cd /home/ec2-user.
  5. Downloading the CodeDeploy agent installer script from the AWS S3 bucket using wget.
  6. Granting executable permissions to the installer script with chmod +x ./install.
  7. Running the CodeDeploy agent installer script in automatic mode with sudo ./install auto.

By following these instructions, you will set up your EC2 instance to be ready for deploying and managing Java Spring Boot applications using CodeDeploy.

.

Created .ppk key pair

.
.

Assign Proper IAM Role for Code Deploy

.
.
sudo yum update
sudo yum install java-17-amazon-corretto-headless.x86_64 -y
sudo yum install ruby -y
cd /home/ec2-user
wget https://aws-codedeploy-us-east-1.s3.us-east-1.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto
.
.
.
.
.
.

You can verify the installation.

sudo service codedeploy-agent status
java -version

It is recommended to let the AWS Systems manager Deploy the agent , In our scenario we are doing everything manually.

Satheshwaran Manoharan
Satheshwaran Manoharanhttps://www.azure365pro.com
Award-winning Technology Leader with a wealth of experience running large teams and diversified industry exposure in cloud computing. From shipping lines to rolling stocks.In-depth expertise in driving cloud adoption strategies and modernizing systems to cloud native. Specialized in Microsoft Cloud, DevOps, and Microsoft 365 Stack and conducted numerous successful projects worldwide. Also, Acting as a Technical Advisor for various start-ups.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

× How can I help you?