Posts

Showing posts from 2020

AWS Lambda with API Gateway and spring boot

Image
Authentication with Firebase using AWS Lambda, API Gateway and Spring boot In this post, i will show you an example on how to create a Lambda function using a spring boot application, and then access the lambda function using API Gateway. A good use- case for this kind of set-up is as follows: Consider you have an api key which you are using to access a backend service like Firebase authentication.  Assuming that you have a frontend single page application like Angular, React etc, in a typical scenario you provide the api key in the environment.ts file and then invoke the backend using the api.  The biggest problem obviously is that since the single page applications are executed on the browser, anyone accessing the application can use the api key. There are different ways to solve this problem, for example keep the key in some backend application and make a request to the backend application to fetch the key. Though i feel this is not the best solution as the end users can still inspe

Elastic Search On AWS with Spring boot and Angular

Image
As a follow-up of my previous post where we setup a spring boot application integration with elastic search, the next goal is to deploy the entire stack including the backend (i.e Elastic search and Spring boot application) as well as the front-end (Angular application) on AWS. Please refer to the blog post   and the source code (including front-end) for further details. Pre-requisites AWS Account (free- tier should be sufficient) Sample applications along with sample elastic search index jsons (all available in the above mentioned source code). Step 1: Creating Elastic search domain on AWS Create an elastic search domain on AWS and assign the following access policy so that the elastic search has a public access: Initially provide it with public access as follows: Add caption Create Index document using Postman: URL: <url of elastic search domain created above> /employee_index?include_type_name=true Method: PUT Header: Content-type:application/json Body: <copy content of the

Spring Boot with Elastic Search

Image
Spring Boot With Elastic Search Elastic Search setup Installation The latest version can be downloaded from the following link: https://www.elastic.co/downloads/elasticsearch The server can be started by executing the elasticsearch.bat (for windows). Access http://localhost:9200 and you should get an output similar to this: { "cluster_name" : "elasticsearch", "cluster_uuid" : "LPD9wz2cSqOrzB9hUYCfGA", "version" : { "number" : "7.6.2", "build_flavor" : "default", "build_type" : "zip", "build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f", "build_date" : "2020-03-26T06:34:37.794943Z", "build_snapshot" : false, "lucene_version" : "8.4.0", "minimum_wire_compatibility_version" : "6.8.0", "minimum_index_compatibility_version" : "6.0.0