Lambda & SAM Flashcards

1
Q

AWS SAM Template Anatomy

Sections of SAM Template

A
  1. Transform (reqd)
  2. Globals (optional)
  3. Description (optional)
  4. Resources section. (reqd)
  5. Metadata (optional)
  6. Parameters (optional)
  7. Mappings (optional)
  8. Conditions (optional)
  9. Outputs (optional)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

AWS SAM resources

A
AWS::Serverless::Api
AWS::Serverless::Application
AWS::Serverless::Function
AWS::Serverless::HttpApi
AWS::Serverless::LayerVersion
AWS::Serverless::SimpleTable
AWS::Serverless::StateMachine
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

AWS::Serverless::Api

A

Creates a collection of Amazon API Gateway resources and methods that can be invoked through HTTPS endpoints.

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

AWS::Serverless::Application

A

Embeds a serverless application from the AWS Serverless Application Repository or from an Amazon S3 bucket as a nested application

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

AWS::Serverless::Function

A

Creates a Lambda function, IAM execution role, and event source mappings that trigger the function.

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

AWS::Serverless::HttpApi

A

Creates an API Gateway HTTP API, which enables you to create RESTful APIs with lower latency and lower costs than REST APIs

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

AWS::Serverless::LayerVersion

A

Creates a Lambda LayerVersion that contains library or runtime code needed by a Lambda Function.

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

AWS::Serverless::SimpleTable

A

Creates a DynamoDB table with a single attribute primary key. It is useful when data only needs to be accessed via a primary key.

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

AWS::Serverless::StateMachine

A

Creates an AWS Step Functions state machine, which you can use to orchestrate Lambda functions and other AWS resources to form complex and robust workflows.

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

Deploying Serverless Applications Gradually

Steps Involved in built-in with CodeDeploy to provide gradual Lambda deployments

A
  • Deploys new versions of your Lambda function, and automatically creates aliases that point to the new version.
  • Gradually shifts customer traffic to the new version until you’re satisfied that it’s working as expected, or you roll back the update.
  • Defines pre-traffic and post-traffic test functions to verify that the newly deployed code is configured correctly and your application operates as expected.
  • Rolls back the deployment if CloudWatch alarms are triggered.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Deployment Preference Types

A

Canary: Traffic is shifted in two increments. You can choose from predefined canary options. The options specify the percentage of traffic that’s shifted to your updated Lambda function version in the first increment, and the interval, in minutes, before the remaining traffic is shifted in the second increment.

Linear: Traffic is shifted in equal increments with an equal number of minutes between each increment. You can choose from predefined linear options that specify the percentage of traffic that’s shifted in each increment and the number of minutes between each increment.

All-at-once: All traffic is shifted from the original Lambda function to the updated Lambda function version at once.

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

Canary

A

Canary: Traffic is shifted in two increments. You can choose from predefined canary options. The options specify the percentage of traffic that’s shifted to your updated Lambda function version in the first increment, and the interval, in minutes, before the remaining traffic is shifted in the second increment.

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

Linear

A

Linear: Traffic is shifted in equal increments with an equal number of minutes between each increment. You can choose from predefined linear options that specify the percentage of traffic that’s shifted in each increment and the number of minutes between each increment.

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

All-at-once

A

All-at-once: All traffic is shifted from the original Lambda function to the updated Lambda function version at once.

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

Deployment Preference Type

A

Canary10Percent30Minutes

Canary10Percent5Minutes

Canary10Percent10Minutes

Canary10Percent15Minutes

Linear10PercentEvery10Minutes

Linear10PercentEvery1Minute

Linear10PercentEvery2Minutes

Linear10PercentEvery3Minutes

AllAtOnce

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

SAM / Controlling Access to API Gateway APIs

A

Lambda authorizers.

Amazon Cognito user pools.

IAM permissions.

API keys.

Resource policies.

17
Q

Lambda authorizers.

A

Lambda authorizer is a Lambda function that you provide to control access to your API. When your API is called, this Lambda function is invoked with a request context or an authorization token that is provided by the client application.

18
Q

Amazon Cognito user pools.

A

Amazon Cognito user pools are user directories in Amazon Cognito. A client of your API must first sign a user in to the user pool, and obtain an identity or access token for the user. Then your API is called with one of the returned tokens. The API call succeeds only if the required token is valid

19
Q

IAM permissions.

A

You can control who can invoke your API using IAM permissions. Users calling your API must be authenticated with IAM credentials. Calls to your API only succeed if there is an IAM policy attached to the IAM user that represents the API caller, an IAM group that contains the user, or an IAM role that is assumed by the user.

20
Q

API keys.

A

API keys are alphanumeric string values that you distribute to application developer customers to grant access to your API.

21
Q

Resource policies.

A

Resource policies are JSON policy documents that you can attach to an API Gateway API to control whether a specified principal (typically an IAM user or role) can invoke the API