|

AWS Create an EC2 Instance

Overview

Create an EC2 instance for Spring boot application

Create EC2

Lets create an EC2 instance. Goto EC2 dashboard and click on "Launch Instance"

Select Amazon Linux 2 or any AMI you wish

Select the Instance Type and click Next. We are going with free tier here:

Next screen :

Start with 1 instance
Network - select joan-vpc
Subet - Either one
Other options leave for now

Select the default assigned storage on next screen and click next

You may add name in next page if you wish

Create a security group in the next screen. Lets add a new rule for our application port 8080 and click on "Review and Launch"

Create a new pair and download key pair

Elastic IP

From the left menu, select "Elastic IP" and click on "Allocate Elastic IP address". Click on "Amazon Pool" and select "Allocate"

Next screen, Associate the address with ec2 instance

Now the ec2 will have the public IP address associated

Connecting via SSH

Unix/Mac can connect from Terminal. Windows might need Putty/ConEmu. Unix, you might need to first set right permissions to the key file

chmod 400 joan-keys.pem

Now ssh and update libraries first

# ssh -i joan-keys.pem [email protected]
The authenticity of host '3.221.227.151 (3.221.227.151)' can't be established.
ECDSA key fingerprint is SHA256:BNvCp1MsHDQDM9LGNKajJlB6/kXTfswdKvxjty0LWA4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '3.221.227.151' (ECDSA) to the list of known hosts.

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/
[ec2-user@ip-10-0-0-64 ~]$ sudo yum update

sudo yum update

Similar Posts

  • | | |

    Deploying a Docker (Java Spring Boot) application to AWS

    Overview Here we will deploy a Java Spring Boot Docker application into AWS infrastructure Create a VPC Create a VPC first as described here EC2 Create an instance and associate an elastic IP address here Docker Install Docker for Amazon Linux 2 sudo amazon-linux-extras install docker Start the docker sudo service docker start Add the ec2-user to…

  • |

    AWS Cloudwatch

    Overview AWS Cloudwatch is a monitoring tool that let you sleep peacefully while doing the watch for you. You can use it set Alarms & Notifications and do actions in response to events, You can get alerts regarding your EC2 instance, Billing updates or other resources. You can also set actions in response to CloudWatch…

  • |

    Aws Core Services

    Overview To identify some of the most commonly used services by developers Elastic Cloud Compute (EC2) Amazon EC2 is a web service that provides secure, resizable compute capacity in the cloud. https://aws.amazon.com/ec2/ Simple Storage Service (S3) Amazon S3 is an object storage service that offers scalability, data availability, security, and performance. https://aws.amazon.com/s3/ Relational Database Service…

  • AWS Autoscaling

    Overview Lets go over a series of steps to setup AWS Autoscaling. Please refer here for a complete tutorial Custom AMI AMI refers to Amazon Machine Image and we can create a custom AMI from an existing instance where our required softwares are installed. Create it from EC2 instances page. Give a name and create:…

Leave a Reply

Your email address will not be published. Required fields are marked *