Amazon API Gateway and AWS Lambda: Better Together
The document discusses the integration of Amazon API Gateway and AWS Lambda to build scalable applications. It outlines how to implement authentication, manage caching, and utilize various AWS services such as Amazon S3 and DynamoDB in a microservice architecture. Additionally, it covers the operational efficiency and cost-effectiveness of using these services together to develop rapid back-end solutions for mobile and web applications.
Introduction to Amazon API Gateway and AWS Lambda as complementary tools for building applications.
Emphasis on the components needed for developing a brand new application, including application data and various platforms like websites and mobile apps.
Details on essential elements of application architecture, including files, databases, API calls, and key concepts like authentication, caching, and business logic.
Explores integration of AWS services like S3, DynamoDB, Cognito, and authentication methods for accessing AWS services securely.
Explanation of AWS Lambda and API Gateway functionalities, including caching, monitoring, and the benefits of serverless architectures.
Illustrates how to define API endpoints using resources and HTTP methods for CRUD operations in an application.
Practical example of a media sharing application using AWS services, highlighting various functionalities and user interactions.
Discussion on the importance of focusing on specific ideas within a microservice architecture for scaling solutions.
Encourages focusing on innovative ideas and offers a link to AWS's free services.
X Authentication Providers End Users User Credentials Authentication Token Amazon Cognito IdentityBroker Identity Pool Id (Token) Identity Id AWS Temp Credentials (Depending on Auth / Unauth Role) Access to AWS Services (Including Amazon API Gateway) Identity Id AWS Temp Credentials Amazon S3 Amazon DynamoDB Amazon Mobile Analytics Amazon Cognito Sync Store K / V Authentication & Authorization Amazon CognitoCheck Token
13.
X End Users User Credentials Authentication Token Amazon Cognito IdentityBroker Identity Pool Id (Token) Identity Id AWS Temp Credentials (Depending on Auth / Unauth Role) Access to AWS Services (Including Amazon API Gateway) Identity Id AWS Temp Credentials Amazon S3 Amazon DynamoDB Amazon Mobile Analytics Amazon Cognito Sync Store K / V Custom Authentication Service Get Token Token Authentication & Authorization Amazon Cognito
Managed Cache toStore API Responses Reduced Latency and DDoS Protection through Amazon CloudFront SDK Generation for iOS, Android and JavaScript HTTP 429 Response for API Throttling (Managed by the SDK) Swagger Support Request / Response Data Transformation and API Mocking
17.
Business Logic AWS Lambda AWS Lambda Functions Amazon APIGateway Amazon S3 Amazon DynamoDB Amazon Cognito Sync Store K / VAmazon SNS Amazon Kinesis Alexa Skills Kit (ASK) Alexa Voice Service (AVS) HTTPS Invoke Custom Events HTTPS REST API Call
18.
console.log('Loading function'); exports.handler =function(event, context) { console.log('value1 =', event.key1); console.log('value2 =', event.key2); console.log('value3 =', event.key3); // Echo back the first key value context.succeed(event.key1); // context.fail('Something went wrong'); };
19.
Build Back-end Servicesthat Perform at Scale Respond Quickly to New Information Run Your Code without Managing Infrastructure Cost-effective and Efficient
λ λ λ Amazon API Gateway λ λ λ λ BucketUsage Table Media Metadata Table User Stat Table User Location Table K / V λ λ λ Amazon Cognito Identity Broker Amazon Cognito Sync Store Amazon SNS Amazon Kinesis Media Bucket Log Table Authentication & Authorization Upload Picture / VideoUpdate Bucket UsageCheck Bucket Usage Delete “Over Quota” Media Send Notification to User / Application Extract Metadata and Write on DB Update User Statistics Call REST API to Get Media Description Upload Location Info Update User Location Look for Users or Media Near Current Location Call REST API to Get User Info Sync Media and User Rating Write History of Changes Check and Update Ratings Invoke Read Write / Send