Deployment of EC2 Instance to Amazon Web Services

ScottAnderson253 58 views 42 slides May 29, 2024
Slide 1
Slide 1 of 42
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42

About This Presentation

Presentation on how to Create an EC2 Instance with AWS


Slide Content

Login to AWS Account
Navigate to your AWS Console
Deployment
Create EC2 Instance with AWS

1. Click “Free tier only”
2. Select Amazon Linux 2 AMI (HVM)
Deployment
Create EC2 Instance with AWS

1. Click on Launch Instance
2. Click Configure Instance Details
Deployment
EC2 Instance Configuration

Configure Instance Details : Do not change these settings
Click “Next”
Deployment
EC2 Instance Configuration

 Add Storage: Do not change Storage Settings
Deployment
EC2 Instance Configuration

Add Key
Key: “NAME”
Value: “springboot-git-wozu-labone”
Click “Next”
Deployment
EC2 Instance Configuration

Configure Security Group
Add new Security Group
Type: “Custom TCP Rule”
Protocol: TCP
Port Range: 8080
Source: “Anywhere”
Description: “Spring Boot Web Services”
Deployment
EC2 Instance Configuration

Launch the Instance
Create a new key pair named “springboot-git-wozu-labone.pem”
Deployment
EC2 Instance Key Pair

Save key to directory “springboot-git-wozu-labone.pem”
Deployment
EC2 Instance Key Creation

The instance is created and initializing
The Instance may take 5-10min to complete initializing
Deployment
EC2 Instance Initialization

1. Open Putty Key Generator
2. Click Load
4. Open “springboot-git-wozu-labone.pem”
3. Click “All Files to show the .pem files”
Deployment
Putty Key Generator

1. Click “Save private key”
2. Click “Yes”
Deployment
Putty Key Generator

1. Save “private key” as “springboot-git-wozu-labone.ppk”
Deployment
Putty Key Generator

1. Find “Public IPv4 DNS” on “Instance Summary” page
2. Click copy icon
Deployment
AWS EC2 Instance

1. Click Connect
Deployment
Connect to AWS EC2 Instance

1. Click “EC2 Instance Connect”
2. Locate the User name “ec2-user”
3. Open Notepad and document the
User name “ec2-user”
Deployment
Connect to AWS EC2 Instance

Document : “User name”
Document : “My AWS Domain” (Public IPv4 DNS)
Deployment
AWS EC2 Instance

1. Click “Services”
1. Click “S3”
Create Bucket for EC2 Instance
Deployment

1. Name Bucket “springboot-git-wozu-labone”
Deployment
Create Bucket for EC2 Instance

1. Uncheck “Block all public access”
2. Click checkbox “I acknowledge…”
Deployment
Create Bucket for EC2 Instance

1. Click “Create Bucket”
Deployment
Create Bucket for EC2 Instance

1. Bucket is created
Deployment
Create Bucket for EC2 Instance

SpringbootGitWozuLabOneApplication.java
SpringbootGitWozuLabOneApplication.java
Deployment

GreetingController.java
GreetingController.java
Deployment

Create JAR File with STS
Deployment
Greeting.java

1.Navigate to “springboot-git-wozu-labone”
2.Click “Maven Install”
Create JAR File with STS
Deployment

1. Click “target” folder
2. See JAR file
Create JAR File with STS
Deployment

Upload JAR File into Bucket
1. Click “Upload”
Deployment

1. Click “Add files”
Upload JAR File into Bucket
Deployment

1. Open directory “springboot-git-wozu-labone”
2. Open JAR “springboot-git-juno-0.0.1-SNAPSHOT” directory
Upload JAR File into Bucket
Deployment

1. Upload JAR file and wait for upload to complete
Upload JAR File into Bucket
Deployment

1. Click on JAR file
Upload JAR File into Bucket
Deployment

1.Click ”Make public”
- Now the “Bucket” and the
“Object“ are both public
Upload JAR File into Bucket
Deployment

 Copy Object URL
Upload JAR File into Bucket
Deployment

1. Copy and paste“My AWS Domain” (Public
IPv4 DNS) to the “Host Name” field 2. Click “SSH”
3. Click “Auth”
4. Click “Browse”
Putty
Deployment

 Open “springboot-git-wozu-labone.ppk”
Deployment
Putty

1. Login with EC2 instance User name “ec2-user”
2. Putty is connected to the AWS EC2
Instance “springboot-git-wozu-labone
Deployment
Putty

1.Make yourself root user
 sudo -i
Install Java Run-time
Putty Terminal
2. Install java Run-time
 yum install java- 1.8.0-openjdk
Deployment

1. Enter command
 wget https://springboot-git-wozu-labone.s3.us-east-2.amazonaws.com/springboot-git-juno-0.0.1-SNAPSHOT.jar
Deployment
Install JAR File into Putty Root Directory

1. Enter command into Putty Terminal
dir
- The command will show the JAR file
installed in the Putty root directory
Deployment
Install Java Run-time

1.Insert following command into Putty Terminal to
run JAR file as SpringBoot API
 java -jar springboot-git-juno-0.0.1-SNAPSHOT.jar
Run Instance from Putty
Deployment

1.Open bowser and enter MY AWS DOMAIN (Public IPv4 DNS) followed by URL for Java API
 ec2-18-216-118-101.us-east-2.compute.amazonaws.com:8080/api/greetings/greeting?name=hs
Connect to EC2 Instance from Browser
Deployment