Skip to main content


Showing posts from February 27, 2023

Introduction to Elasticsearch

Greetings! Elasticsearch is a powerful tool that most companies use for various use cases. It is the best tool we can use to give users a seamless search experience. Before jumping in, let's try to understand it at a high level. We know that our data is there in our databases, however, we are not able to retrieve them faster mostly due to the spreadsheet-like data structure. Elasticsearch is document-oriented, meaning it stores data as documents as it is. It not only saves documents but also makes them easy to searchable. What is Elasticsearch Elasticsearch is a distributed, free, and open search and analytics engine for all types of data, including textual, numerical, geospatial, structured, and unstructured. Elasticsearch is built on top of Apache Lucine but hides the complexity behind a simple, coherent, restful API. We can name a few use cases. Search in websites Logging and log analytics Application performance monitoring Geospatial data analysis and visualization Security ana

How to create an AWS Cognito user pool using CloudFormation

Greetings! In my previous article, I created a Cognito user pool using the AWS console. However, that is not a good practice in real projects as it involves a lot of manual work. That is why we need to leverage infrastructure as code. In this article, we create the same setup using CloudFormation. It turned out that there is no proper example in the documentation and the documentation is also a little confusing. Had to do a little trial and error and dig the internet as well. What we need We need to create a user pool and register a client. After that, we need to retrieve an access token for the logged-in user. Steps We mainly need to configure; UserPool UserPoolClient UserPoolDomain Here is the complete CloudFormation template. AWSTemplateFormatVersion: "2010-09-09" Description: Cognito Stack Resources: MyWebAppUserPool: Type: AWS::Cognito::UserPool Properties: UserPoolName: my-web-app-user-pool Policies: PasswordPolicy: