Configuring EC2 and Connecting to S3

  1. Access the created EC2 instance and click Copy the Public IPv4 address

ec2deploy

  1. Open CMD, navigate to the directory containing the EC2 keypair, and execute the following code to SSH into the EC2 instance:
ssh -i "your-keypair.pem" ec2-user@<EC2-PUBLIC-IP>

ec2deploy

  1. Copy the S3 object URL of the uploaded JAR file ec2deploy

  2. Configure the file path

ec2deploy

  1. Click the Copy icon to copy the path

ec2deploy

  1. Enter the command below to download the JAR file from S3 to EC2
pwd 'links3'

ec2deploy

  1. Wait for the download to complete. A 100% progress notification will appear in CMD

ec2deploy

  1. Run the following command to rename the file
mv 'namefile' newName
ls

ec2deploy

  1. Install Java 22 using the command below
sudo yum install java-22
ls

ec2deploy

  1. Wait for Java 22 to be installed on the EC2 instance

ec2deploy

  1. Proceed with the following steps to run the web application
  • Verify the Java version
  • Launch the application
java -version
java -jar DASpring.jar
ls

ec2deploy

  1. Check the running application’s details

ec2deploy

  1. Add a port to the inbound rules in the EC2 security group.
  • Click add Rule
  • Select “Custom TCP” from the rule type dropdown
  • Enter port 8080 in the port range field
  • Set source to “Anywhere” (0.0.0.0/0 for IPv4)
  • Click “Save rules” to apply the changes

ec2deploy

Congratulations! You’ve completed deploying the E-Commerce Full-Stack application (specializing in electronics) on AWS. In the next section, we’ll test the deployed web application.