Serverless Flashcards

1
Q

Which services can API gateway interface to?

A

LAMBDA - easy way to expose REST API

HTTP - Expose HTTP end points including LB.

AWS Services - Expose any AWS API eg. Start a step function post msg to SQS, Kinesis etc.

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

Wbat are the 3 endpoints types for API Gateway

A

Edge Optimized (default) -> Request routed through CloudFront to improve latency

Regional-> For clients in same region.

Private -> only accessed from your VPC

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

AWS Serverless Application Repo (SAR)

A

The AWS Serverless Application Repository is a managed repository for serverless applications. It enables teams, organizations, and individual developers to store and share reusable applications, and easily assemble and deploy serverless architectures in powerful new ways.

Each application is packaged with an AWS Serverless Application Model (SAM) template that defines the AWS resources used. Publicly shared applications also include a link to the application’s source code. There is no additional charge to use the Serverless Application Repository - you only pay for the AWS resources used in the applications you deploy.

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

AWS Marketplace

A

AWS Marketplace - The AWS Marketplace enables qualified partners to market and sell their software to AWS Customers

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

AWS Service Catalog

A

AWS Service Catalog - AWS Service Catalog allows organizations to create and manage catalogs of IT services that are approved for use on AWS. These IT services can include everything from virtual machine images, servers, software, and databases to complete multi-tier application architectures.

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

you create a new version of a Lamda function but want to specify only a certain % of traffic goes to this and rest of traffic goes to old one. how would you do this?

A

Create a LAMBDA Alias pointing to LATEST. Setup your app to point to this Alias. WHen you ddploy a new version, you’d set the weighting to 90% to old version and 10% to newest version.

You can create one or more aliases for your AWS Lambda function. A Lambda alias is like a pointer to a specific Lambda function version. You can use routing configuration on an alias to send a portion of traffic to a Lambda function version. For example, you can reduce the risk of deploying a new version by configuring the alias to send most of the traffic to the existing version, and only a small percentage of traffic to the new version.

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

How to imrpove performance for API Gateway

A

Enable API caching in API Gateway

API Gateway provides a few strategies for optimizing your API to improve responsiveness, like response caching and payload compression. You can enable API caching in Amazon API Gateway to cache your endpoint’s responses. With caching, you can reduce the number of calls made to your endpoint and also improve the latency of requests to your API.

API Gateway does NOT support ElasticCache or MemCache.

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

How would you expose an API in AWS and only make it available to select users?

A

API GATEWAY USAGE PLAN

A usage plan specifies who can access one or more deployed API stages and methods—and also how much and how fast they can access them. The plan uses API keys to identify API clients and meters access to the associated API stages for each key.

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

Max environment variable size for Lambda

A

4K. No limit to the number.

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

Step function Characteristics

A

Standard Workflows on AWS Step Functions are suitable for long-running, durable, and auditable workflows that can also support any human approval steps

You should use Express Workflows for workloads with high event rates and short duration

Express Workflows have a maximum duration of five minutes and Standard workflows have a maximum duration of one year

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

How to promote a Test Stage to a Prod stage for API Gateway.

A

THere are 2 ways. Optimal way is just to update a stage variable value from the stage name of test to that of prod.

The other way is to re-deploy the app to Prod Stage.

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

Adress Lambda Performance lags on compute heavy workloads

A

increase memory. memory can be increased in 64MB chunks from 128MB to 3008MB.

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

Lambda Provisioned v Reserved currency.

A

Reserved Concurrency is about guaranteeing availability, while Provisioned Concurrency, with its “pre-warm” mode, is about ensuring immediate, predictable performance, eliminating cold start latency.

Reserved concurrency is useful for ensuring that your most critical functions always have enough concurrency to handle incoming requests. Configuring reserved concurrency for a function incurs no additional charges.

Provisioned concurrency is useful for reducing cold start latencies for functions. Configuring provisioned concurrency incurs additional charges to your AWS account.

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

Which Lambda concurreny mode helps with cold starts?

A

Provisioned concurrency

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

Use AWS Step Functions state machines v. Step Functions activities

A

Step function activities are used to orchestrate the task running in a different machine called worker, which will take the input from the step function state machine.

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

How can you use a template for creating complex CF serverless applications ?

A

SAM - Serverless Applicaiton Framework.

If you see TRANSFORM, think SAM.

USes Receipes to define applications in a YAML or JSON format

USe Sam Build/Sam Deplpoy/Sam Sync

Produces CF templates

17
Q
A
18
Q

best way to monitor files/logs on EC2 and send to kinesis ?

A

use kinesis agent installed on EC2.

Kinesis Agent is a stand-alone Java software application that offers an easy way to collect and send data to Kinesis Data Streams. The agent continuously monitors a set of files and sends new data to your stream.

19
Q

how can a customer invalidate cache for API-Gateway and force load of new data ?

A

Using the Header Cache-Control: max-age=0

20
Q

How would you control API Gateway authorisation using a 3rd party authorisation mechanism.

A

Lambda Authoriser.

An Amazon API Gateway Lambda authorizer (formerly known as a custom authorizer) is a Lambda function that you provide to control access to your API. A Lambda authorizer uses bearer token authentication strategies, such as OAuth or SAML. Before creating an API Gateway Lambda authorizer, you must first create the AWS Lambda function that implements the logic to authorize and, if necessary, to authenticate the caller.

21
Q

Does AWS Lambda support WIndows Containers?

A

no. only linux.

22
Q

max size of lambda linux container

A

10GB.

23
Q

Differene between Beanstalk Deploy Rolling with Additional Batch verses Immutable.

A

The ‘Immutable’ deployment policy ensures that your new application version is always deployed to new instances, instead of updating existing instances. It also has the additional advantage of a quick and safe rollback in case the deployment fails. In an immutable update, a second Auto Scaling group is launched in your environment and the new version serves traffic alongside the old version until the new instances pass health checks. In case of deployment failure, the new instances are terminated, so the impact is minimal.

Rolling with additional batch is very similar to a Rolling deployment with one core difference - this type of deployment ensures that your full capacity is maintained during the deployment process.

Full capacity is ensured by launching a new fresh batch of instances before starting the actual deployment - it’s a little more costly (since you need to launch new instances) but your environment’s capactiy is not limited.

24
Q

Deployment Types Beanstalk:

A

All At Once
fastest deploy.
all instances out of services while deploy happens.
best for Dev/Test.
no additional cost.

Rolling
update few instance at a time.
No additional cost.
long deploy time.
reduced capacity during rollout.

Rolling with additional batch
Same as above but adds extra EC2s temporarily
No Performance hit during deploys
longder deploy
additional cost.
good for prod but rollback is manual

Immutable
Launc new ASG and deploys new app to this.
zero downtime.
Best for Prod but most expensive.
Fast Rollbackl
longest Deployment Time.

BLUE GREEN
This isnt a deployment type but a design pattern
You create new stage env and deploy there
Route 53 is setup to send weighted traffic
Elastic Bean Can then swap URLs when ready.

25
Q

Beanstalk Environment types

A
26
Q

Step Express v Standard Workflows

A

You should use Express Workflows for workloads with high event rates and short duration

Standard Workflows on AWS Step Functions are suitable for long-running, durable, and auditable workflows that can also support any human approval steps