DEV Community

Vishnu B
Vishnu B

Posted on Edited on

Deploy your Artifact publicly using AWS Resource within 20 Minutes using AWS EBS AND RDS !!!! - High Level P-2

Update (2026): AWS retired the Amazon Linux 2 platform branch used in this post (Corretto 8 running on 64bit Amazon Linux 2) in August 2026. Choose an Amazon Linux 2023 branch instead, and follow the current Elastic Beanstalk documentation - the console and steps shown here are from 2022 and may have changed.

AWS Elastic Beanstalk -

Elastic Beanstalk is a platform within AWS that is used for deploying and scaling web applications.

Before starting the process, configure the port number to 5000 in the application.properties file of your Spring Boot app.

server.port=5000

Now we need to deploy our application publicly using AWS Elastic Beanstalk (Beanstalk for short).

  1. Search and open the Elastic Beanstalk service in AWS, as shown below.

  2. Once you've landed on the Beanstalk service, click on Create Application.

  3. Now you have to give the application name and metadata (application tags).

  4. During this process, we need to choose the correct platform to run our application. Beanstalk provides some pre-configured AMIs [Amazon Machine Images]. Select Java as the platform, "Corretto 8 running on 64bit Amazon Linux 2" as the platform branch (I'm using Java 8 here), and keep the default platform version.

  5. Click on Upload your code and select Local File.

  6. Click on Choose File, select the jar you need to deploy, and you can add application code tags as well if needed.

What happens in the background during EB environment creation?

Since we selected Java as the platform and "Corretto 8 running on 64bit Amazon Linux 2" as the platform branch, Beanstalk provides a preconfigured EC2 instance (virtual machine) with Java 8 installed and a security group that has port 80 in its inbound rules. No key pair is configured on this EC2 instance, so we can't communicate with it using tools like PuTTY, MobaXterm, etc.

Because this is a single-instance environment, Elastic Beanstalk associates an Elastic IP address with the EC2 instance (a static IP address that will not change after a restart). In a load-balanced environment you would instead reach the application through the load balancer's DNS name.

When we upload the code, it is stored in S3 - Simple Storage Service in AWS (simple storage, like a drive) - and from there it is deployed as the application on the instance.

Once the application has started, you will get a URL under the environment name, like this.

Now the application is hosted on the AWS cloud. You can use this application URL to test the microservices using API testing tools like Postman, Hoppscotch, etc. While testing the application, use this URL instead of localhost and the port number.

Make sure your Spring Boot app listens on port 5000. By default, Elastic Beanstalk's nginx proxy forwards requests coming in on port 80 to your application on port 5000; you can change this with the PORT environment property.

THE END

Top comments (0)