AWS Lambda | Using AWS Lambda to build applications Flashcards

1
Q

What happens if my function fails while processing an event?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

For Amazon S3 bucket notifications and custom events, AWS Lambda will attempt execution of your function three times in the event of an error condition in your code or if you exceed a service or resource limit. For ordered event sources that AWS Lambda polls on your behalf, such as Amazon DynamoDB Streams and Amazon Kinesis streams, Lambda will continue attempting execution in the event of a developer code error until the data expires. You can monitor progress through the Amazon Kinesis and Amazon DynamoDB consoles and through the Amazon CloudWatch metrics that AWS Lambda generates for your function. You can also set Amazon CloudWatch alarms based on error or execution throttling rates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a serverless application?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

Lambda-based applications (also referred to as serverless applications) are composed of functions triggered by events. A typical serverless application consists of one or more functions triggered by events such as object uploads to Amazon S3, Amazon SNS notifications, or API actions. These functions can stand alone or leverage other resources such as DynamoDB tables or Amazon S3 buckets. The most basic serverless application is simply a function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do I deploy and manage a serverless application?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

You can deploy and manage your serverless applications using the AWS Serverless Application Model (AWS SAM). AWS SAM is a specification that prescribes the rules for expressing serverless applications on AWS. This specification aligns with the syntax used by AWS CloudFormation today and is supported natively within AWS CloudFormation as a set of resource types (referred to as “serverless resources”). These resources make it easier for AWS customers to use CloudFormation to configure and deploy serverless applications, using existing CloudFormation APIs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can I discover existing serverless applications developed by the AWS community?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

You can choose from a collection of serverless applications published by developers, companies, and partners in the AWS community with the AWS Serverless Application Repository. After finding an application, you can configure and deploy it straight from the Lambda console.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do I automate deployment for a serverless application?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

You can automate your serverless application’s release process using AWS CodePipeline and AWS CodeDeploy. CodePipeline is a continuous delivery service that enables you to model, visualize and automate the steps required to release your serverless application. CodeDeploy provides a deployment automation engine for your Lambda-based applications. CodeDeploy lets you orchestrate deployments according to established best-practice methodologies such as canary and linear deployments, and helps you establish the necessary guardrails to verify that newly-deployed code is safe, stable, and ready to be fully released to production.

To learn more about serverless CI/CD, visit our documentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do I get started on building a serverless application?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

To get started, visit the AWS Lambda console and download one of our blueprints. The file you download will contain an AWS SAM file (which defines the AWS resources in your application), and a .ZIP file (which includes your function’s code). You can then use AWS CloudFormation commands to package and deploy the serverless application that you just downloaded. For more details, visit our documentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do I coordinate calls between multiple AWS Lambda functions?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

You can use AWS Step Functions to coordinate a series of AWS Lambda functions in a specific order. You can invoke multiple Lambda functions sequentially, passing the output of one to the other, and/or in parallel, and Step Functions will maintain state during executions for you.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do I troubleshoot a serverless application?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

You can enable your Lambda function for tracing with AWS X-Ray by adding X-Ray permissions to your Lambda function’s execution role and changing your function’s “tracing mode” to “active. “ When X-Ray is enabled for your Lambda function, AWS Lambda will emit tracing information to X-Ray regarding the Lambda service overhead incurred when invoking your function. This will provide you with insights such as Lambda service overhead, function init time, and function execution time. In addition, you can include the X-Ray SDK in your Lambda deployment package to create your own trace segments, annotate your traces, or view trace segments for downstream calls made from your Lambda function. X-Ray SDKs are currently available for Node.js and Java. Visit Troubleshooting Lambda-based applications to learn more. AWS X-Ray rates will apply.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How is AWS SAM licensed?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

The specification is open sourced under Apache 2.0, which allows you and others to adopt and incorporate AWS SAM into build, deployment, monitoring and management tools with a commercial-friendly license. You can access the AWS SAM repository on GitHub here.

Lambda@Edge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Lambda@Edge?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

Lambda@Edge allows you to run code across AWS locations globally without provisioning or managing servers, responding to end users at the lowest network latency. You just upload your Node.js code to AWS Lambda and configure your function to be triggered in response to Amazon CloudFront requests (i.e., when a viewer request lands, when a request is forwarded to or received back from the origin, and right before responding back to the end user). The code is then ready to execute across AWS locations globally when a request for content is received, and scales with the volume of CloudFront requests globally. Learn more in our documentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do I use Lambda@Edge?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

To use Lambda@Edge, you just upload your code to AWS Lambda and associate a function version to be triggered in response to Amazon CloudFront requests. Your code must satisfy the Lambda@Edge service limits. Lambda@Edge only supports Node.js for global invocation by CloudFront events at this time. Learn more in our documentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When should I use Lambda@Edge?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

Lambda@Edge is optimized for latency sensitive use cases where your end viewers are distributed globally. Ideally, all the information you need to make a decision is available at the CloudFront edge, within the function and the request. This means that use cases where you are looking to make decisions on how to serve content based on user characteristics (e.g., location, client device, etc) can now be executed and served right from the edge in Node.js-6.10 without having to be routed back to a centralized server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can I deploy my existing Lambda functions for global invocation?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

You can associate existing Node.js-6.10 Lambda functions with CloudFront events for global invocation if the function satisfies the Lambda@Edge service limits. Read more here on how to update your function properties.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What Amazon CloudFront events can be used to trigger my functions?

Using AWS Lambda to build applications

AWS Lambda | Compute

A

Your functions will automatically trigger in response to the following Amazon CloudFront events:

Viewer Request - This event occurs when an end user or a device on the Internet makes an HTTP(S) request to CloudFront, and the request arrives at the edge location closest to that user.

Viewer Response - This event occurs when the CloudFront server at the edge is ready to respond to the end user or the device that made the request.

Origin Request - This event occurs when the CloudFront edge server does not already have the requested object in its cache, and the viewer request is ready to be sent to your backend origin webserver (e.g. Amazon EC2, or Application Load Balancer, or Amazon S3).

Origin Response - This event occurs when the CloudFront server at the edge receives a response from your backend origin webserver.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly