You’ve probably heard the buzz word API go around a lot. API stands for “Application Programming Interface”. If you don’t know what that means the official definition is as below:

“An application programming interface (API) is a set of protocols, routines, functions and/or commands that programmers use to develop software or facilitate interaction between distinct systems.” — Technopedia

Ref — https://www.techopedia.com/definition/24407/application-programming-interface-api

What it means in very simple words is that API’s are a way for computer programs or softwares to share information or data with each other. They are used by company softwares to exchange information with other company softwares or even within the same company. API’s are very heavily used today especially with the rapid popularity of Big Data technologies and affordable Cloud Computing.

Every time you open an app on your phone its most likely that the app is making an API request to another software.

How an API works

In this post I would like to show you how to create your first API using Amazon Web Services (AWS) in 6 steps. You will be using CloudFormation which is Amazon’s templating language for creating “Infrastructure as Code (IaC)” which means we can define a template (JSON in this case) to provision every AWS resource we require to build the API.

You can find the reasons why its beneficial to use IaC instead of manually creating resources in the AWS Console below.

Skills and Knowledge Required

This post assumes some basic knowledge about Python, AWS CLI (command line interface) and AWS Services mainly Lambda, API Gateway, CloudFormation, IAM Roles, CloudWatch, Service and IAM Roles.

PLEASE NOTE: You may incur AWS charges as part of this deployment. Please check your Free Tier utilisation and make sure you understand the AWS charges involved.

Step -1 Design your Serverless API and Architecture

Its important to plan the API and architecture before writing any code, template or create resources in the Console.

In this example you will create an API which when called responds with a URL to a Car Image stored in a S3 Bucket.

Below is the Architecture Diagram created for this tutorial in https://cloudcraft.co/.