Micro-service with AWS ElasticBeanStalk | Part1

  • EC2 :- The first service created by EBS is EC2. EC2 stands for Elastic Compute Cloud. These are the virtual servers on which our application is deployed. EC2 is basically a web service to obtain virtual resources, virtual servers in the cloud. EC2 supports a variety of resource configurations. We can configure memories, CPUs, storage, network capacity, and a variety of other things for our virtual servers. EC2 instances are charged by the amount of time they are running. So, if we keep our EC2 instance running for a long time and we exceed the free tier limit, we shall be charged. In this scenario, EBS application have launched a “t2.micro” type of instance, which is currently part of the free tier.
  • EBS :- The Elastic-BeanStalk application also did created the an EBS (elastic block store) by default for us. If we go-to volumes, we’d see that there is one volume of 8 GB which is associated with this specific instance. So this is basically the hard disk which is attached to the virtual server. The elastic block stores serves the purpose of a typical hard disk on your machine. So an elastic block store instance is created and attached with our EC2 instance.
  • Security-Group :- Elastic-BeanStalk application have also created something known as a security group with the same name as the EC2 instance. The important thing to understand is, we can use security groups to configure what kind of traffic is coming into our instance, and what kind of traffic is going out of our instance.
  • DEV environment.
  • QA environment.
  • UAT environment.
  • PROD environment.
  • If we want to create a batch environment, we choose a worker Environment.
  • If we want to deploy a web application, then we shall choose web-server-environment.
curl --location --request POST 'http://microserviceebs-dev.eba-rxbhveqq.us-east-2.elasticbeanstalk.com//users/govind/tasks' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "govind",
"description": "Learn to Drive a Car",
"targetDate": "2030-11-09T10:49:23.566+0000",
"done": false
}'
  • The other interesting thing you’d see here is application versions. Basically all the versions of the applications that we have uploaded until now, while we have deployed and below are stored in here.
  • And it also shows current environment where a specific thing is deployed to ? So, it shows that this jar version label is deployed to this, and version.
  • Version-Label “Sample Application” is running on the newly launched “Microserviceebs-QA” environment.
  • Version-Label “EBS-MS-H2-JPA-REST-1” is running onto our old “Microserviceebs-dev” environment.
  • nginx receives this request on port 80 and it would redirect it to the application which is running in the background, on port 5000.
  • So nginx does that, and you can see all the logs for nginx. In here, you can see all the access logs in here.
  • You would see that all the records that we were sending in , you can see them in here. You can see the request, you can see what was the status of the request, and all that fun stuff.
  • They are available containing any errors that happen, this would be useful when you debug stuff.
  • If somebody is not working, you maybe you’d be able to start with nginx log first. The logs are rotated in regular intervals, and they are put into the specific folder which is rotated.

--

--

--

Software Engineer for Big Data distributed systems

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Tech 101: How To Run Metabase On An EC2 Instance

Core Challenge 10: Enemies kill your powerups!

HYWCT: Code

When Less is More: Serverless NAT Gateway — Part 2

Nat Serverless

Live AMA with Paralink

Managing Node.js Environment Config

CS373 Fall 2020: Elias Lampietti

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
aditya goel

aditya goel

Software Engineer for Big Data distributed systems

More from Medium

Amazon API Gateway : Enabling CORS support in mock API response

CICD Pipelines with React, AWS S3, Circleci

Amazon API Gateway: Securing Endpoints using Cognito User Pool

AWS SQS — Interaction between two applications