Connect to EC2 instance using SSH6. To learn more about key pairs, see Amazon EC2 Key Pairs. If you already have applications, look to the right column and click Create Deployment Walkthrough. Login to AWS console and select EC2 service

Create a Rest end Point,which we can access after deployment3. This is how it looks like when you execute commands from your terminal and gets connected to ec2 instance. So,Let us go ahead and add a security group inbound rule. With WinSCP you can easily upload and manage files on your Amazon EC2 (Elastic Compute Cloud) instance/server over SFTP protocol. Single-click deployment from within Eclipse: AWS Toolkit for Eclipse: Java web applications deployed as a JAR, WAR, or ZIP file, and requiring minimal OS changes: JAR, WAR, or ZIP: Automated deployment of packaged application using AWS Elastic Beanstalk: AWS Elastic Beanstalk In this tutorial, explain to you how to upload files to AWS ec2 using WinSCP Server in order to facilitate file transfer to and from your Windows desktop. Install wget if not be available with default EC2 linux instance sudo yum install … Copy our Spring Boot project from our  local machine to EC2 instance5. Click Create. EC2 instance that I got from AMI has open jdk 7 by default.

You will need to launch an AWS virtual machine to deploy your code on.

For this example ,I have given name “springbootproject” to the project,so you can give the same name,as name will be used in further steps. Unzip the downloaded file using the below command sudo tar xzf jdk-8u211-linux-x64.tar.gz4. All rights reserved. In this step, we will select a deployment configuration and then initiate the deployment to our three EC2 instances. When you click here, the AWS Management Console will open in a new browser window, so you can keep this step-by-step guide open. In the Application Name box, enter HelloWorld as the name for your sample application and click Next Step. Install ScreenLinux Screen Command is a very useful command that helps us to use multiple shell windows (sessions) from a single SSH session. Create a Spring Boot Project with Spring Boot Initialiser.2. Note: This can take several minutes to complete. This will helps us for continuous execution of jar file event the SSH session is terminatedOn CentOS 6 or CentOS 7:yum install screenOn Debian 6 / 8 and Ubuntu 14 / 16: apt-get install screen, 6.

Once all three instances are completed, click View All Instances. In this tutorial,we will see how we can deploy a Spring Boot application over an AWS EC2 instance. When the session is detached or there is a network disruption, the process that is started in a screen session will still run and you can re-attach to the screen session at any time. a. In this step, we will launch three EC2 instances using a pre-configured EC2 template. Step 4: Install the AWS CodeDeploy agent on the Amazon EC2 instance For instructions about how to install the CodeDeploy agent on the Amazon EC2 instance and verify it is running, see Managing CodeDeploy agent operations , and then proceed to Create an application with CodeDeploy . Remove JDK 7 and install JDK 8 over EC2 instance7. If you are using an existing service role, choose it from the Role Name drop-down list. As you wait, feel free to review this tutorial with the video below: AWS CodeDeploy uses application names during code deployments to make sure it is referencing the correct deployment components, such as the deployment group, deployment configuration, and application revision. Delete this filter and you will see all the instances launched by CodeDeploy. We can go ahead with JDK 7 as well ,but as I am using JDK most of the times now and compiled my project with jdk 8 only,so I removed JDK 7 and installed JDK 8. java -jar springbootproject-0.0.1-SNAPSHOT.jar, Click on the instance in AWS console and check the security group associated with your instance, As we can see in above screenshot ,the security group attached with this EC2 instance is launch-wizard-1, Now,as we open this security group,I have following entry,which as you can see that allows traffic from internet over port 22 only using SSH.Acatually this was the reason we were able to connect using SSH from our machine to this EC2 instance.If we remove this rule from here,SSh will not work. For example, using the default configuration (“One at a Time”), if you deploy your application to 3 instances, this configuration will deploy to one instance at a time. Note: You have the option to download the sample bundle. 1. If you already have a service role, you can choose Use an existing service role. a. Click the home icon on the upper left corner of the AWS Management Console. A deployment group contains individually tagged instances, Amazon EC2 instances in Auto Scaling groups, or both. Accept the Default Deployment Configuration and click Next Step. How to deploy a Spring Boot Application on AWS EC2 instance, /**
 * @author JavaSolutionsGuide
 *
 */, You can read more on SCP at following link.