Friday, April 10, 2020

AWS as Devops

AWS Devops Source

Amazon Web Services provides all the options that are essential for building a project that follows Devops.
Devops is union of people, process and products to enable delivery of values to our end users,
AWS Devops is set of developer tool that provide complete set CI/CD i.e. continuous integration and continuous deployment from scratch till deployment.




The above diagram explain why we use AWS devops.
AWS is a fully managed source where we get services that is require from scratch till the end.
for example it has it own GitHub, bitbucket, svn to function writing to IDE where we write the code to storage and databases.
It is built for scale i.e. if we have written a function for some set of users or user capacity, at any time in SDLC, we can reduce the reach of that particular method.
It also provide automation i.e. automatic integration of all the services that are associated with the products.
Finally, the best feature Pay as you Go, i.e. pay for the services that we have used and that too pay according the duration of usage.



Monday, April 6, 2020

PM during COVID 19 crisis

जब तक सब अच्छा था, अपनी गलत और थोपने वाली नीतियों से अर्थव्यवस्था को बर्बाद करो, चलते फिरते दुकानों को बंद करो ,छोटे और माध्यम व्यापारियों को टैक्स के नाम पे डरा के धंधा चौपट करवा दो

और जब मुश्किल दौर आये तो उन्ही बर्बाद, तबाह हुए लोगो से कहो की दान करो, गरीबो को खाना दो, सब सही कहा आपने सर

अपने और अपनी पार्टी से देश की राज्यों की सरकारें अश्थिर करवाओ, पैसे से विधायक,संसद खरीदो और कहो की PM CAREs मैं दान दो
सोचिये आज प्रधानमंत्री हम लोग की सेवा कर रहा है की हम उसकी
प्रधानमंत्री जिस रफ़्तार से गलतियों पे गलतियां कर रहे थे, हम ने कभी ध्यान ही नहीं दिया, उनको भी लगा की सब चंगा सी पर मोदीजी कुदरत सब देख रही थी
He is not an asset, he is liability

हे प्रभु अपना गुस्सा शांत करो, हर पल गलती हुई हमसे, हमको दंड दो ,पर अब अपना गुस्सा शांत करो
मैं तुम्हे न कुछ कह सकता हूँ न तुम्हे ही सुनी चाहिए
न ही हम भक्त है की प्रह्लाद की भांति, नरसिम भगवान् का गुसा शांत करवा सके
 पर हम जो भी सही, ये सत्य है की हम तुम्हारे ही बच्चे है, तुम हमारे पालनहार हो
अब प्रभु हमे दर्शन दो,

Friday, April 3, 2020

AWS API Gateway


  • API Keys-API keys are unique identifier that are assigned to API to be executed by a single developer or group of developer.We can understand it like as if it the name of the API. By sharing API Keys, a developer who has created the API gives the access to other developer to use the created API.
  • Custom Domain Name-Custom Domain name is creating the API url by the domain of ours. When we create the application, it is generally hosted on our domain, so for using the API on our domain, we have to pass the API url which has our domain, but for a note, the created API will also work for the AWS created url.
  • Settings-Define the permission that the created API has. By default, no permission are granted to the API that is created. We have to gives all the permission that are required.
First we have to create Create Resource and then Create Method.
Resource is nothing but the path that will be appended in the url path.

  • Models-Models are the area where we define the type of data which we are using.
  • Authorizers-Authorizers is the area where we have to define the permission for the users who will use this API.
  • Documentation-Documentation is the area where we will write the use of the API
  • Binary Support-It work when we sent the file with our request to API
  • Dashboard-Highlevel overview of how our API works.

This is the cyclic diagram of how API actually works 
First box Method Request act as a Gate Keeper
First box is the Method Request which states that how the API must look like, whether this 
Particular API is meeting the criteria that are prescribed, the criteria can be anything, parameter or data model or criteria for schema specification
Also we can do the authentication for the API so that only valid users are able to do the usage of this API.We can say Method Request  is like gatekeeper who keep an eye on the data and their validity.
If the authentication is not met, we simply block the rest of the work that has to be performed.

Second box is Integration Request is used to map the data according to the way we want to use it.Also we can hardcode the data according to the use.The transformation of data can be of any type for instance, authentication data, header data, parameter data and many other.This is the box where we define the function where we have to write the business logic as well.

The third cyclic box is Integration Response and is used to extract the data from the integration request and pass it to method response and here only success response are passed.Also we can transform the data according to the need of client and send it to method response. Integration Response can also be useful in allowing the access control allow for header data type, methods which this particular API can handle and parameter datatype.

The last box is Method Response is the last response box and it will pass all the response whether it is pass or fail and we can give the final touch of how data has to be rendered in front of client.


Thursday, April 2, 2020

AWS Lambda

How to create AWS Lambda Function??
  • Go in the Services and search for Lambda
  • Click on Lambda
  • Once we will click on Lambda, we will navigate to following screen
  • Author from scratch means we will be writing the code from starting, Use a blueprint is a option where AWS provide various template of function
  • Enter the function name and choose the programming language where you want to do the coding.
  • Also no need to change the permission.
  • Click on Create button.And we will be navigated to new screen.
  • We will receive various option present, for instance Test which will test the code snippet that we have written.
  • Logs services are attached to the pre-defined services that are present.
  • Monitoring tab will help us to know the error count, execution time etc for our Lambda function.
  • Function Code section has one major thing to observe, like Handler section where we have to define the file and function that has to be executed first once our Lambda function is triggered.It is because when we design the function, it is not mandatory that only one file and one function is present, it has the chances that multiple function are present, so AWS run must know that which file and the function name has to be triggered.
  • Code Entry type is the thing which allow us to either write the code or upload the zip file that has the code.
  • Various other setting that are important has to be entered.
  • One important entry point is Basic Setting that has the timeout time for the function, As AWS Lambda charges for the time of execution of function, so in this case, it become important to enter the same,

Wednesday, April 1, 2020

RedShift Database AWS

Query used to describe table table_name
  • SELECT * FROM pg_table_def WHERE tablename = 'table_name'

Query to get top 10 record
  • select top 10 * from table_name