General Flashcards

1
Q

What is serverless?

A

No server setup, no iperating system installation, no db install /setup, no hardware updates, no patches, no scale management - serverless abstracts away from us = serverless still use servers but you dont’t have to wory about managing the infrastructure.

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

How serverless works?

A

Event driven computing using small, independent, stateless functions, running inside containers in the cloud.
An event trigers initialisation of a container, to which a function is loaded and executed and the c9ntainer shuts down. AWS lambda does all of tje above :).

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

Hello, World! With lambda & gateway

A

Manualy create a service with API gateway console.

Sign to the console
Look for api gateway
Create a new api ( name)
Resources screen ( create res and methods)
Create a resource ( name, endpoint)
Add a method ( GET …)
Select a mock response.
Method execution screen
Choose integration (?) response
Mapping Templates (json, put message, save)
Deploy API ( deployment stage, name, cDeploy)
Stages screen ( invoke url)
Missing authentication roken (add endpoint to root)
You can test also from mwthodnexecution screen.

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

The first lambda function

A

AWS dashbord (services - lambda)
Create function ( scratch, blueprint, repository)
From scratch ( name, runtime nodejs, role custom- accept default or chamge, cAllow)
cCreateFunction
Scroll down - can see the function
exports.handler = (event, context, callback) …
Define messages array, pick a random string in the handler and return in callback method onside the handler.
cTest ( ru) - confogure test even (empty)
Name event
cTest again.
cLogs - look atbthe latest one

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

Hook function to API gateway

A

API gateway console
Integration request:
Integration type - from mock to lambda function
Lambda region( is in the url of the ‘screen’)
Lambda function - name of the first, cSave
Are you sure …? cOk
Give permissions…? cOk
Test, cTest:
plain text - in integration response pick json template { “message”: $input.body)
Test (in method execution).
Actions, deploy
Test in the browser
Can change runtime to 8+, and replace the function woth async
Test, test in the browser.

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

Key features

A

No server management ( litle or no at all)
Easy amd efficient scalling
Built in high availability and fault tolerant
Service integration (store, send emails etc.)
No idle capacity - pay for what you use ( running code)
Not a silver buller!

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

Cons

A
Vendor lock-ins ( multi provided serverless to the rescue)
Public cloud (serverless can be run in private- how? )
Some contoll given to others
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

AWS core services

A

AWS lambda (2014 others followed, aws /lambda is the winner now)
Amazon API Gateway
Amazon DynamoDB

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

AWS Lambda

A

The most important
Run your code without worying about a server.
Lambda function - each piece of code run in an isolated environment ( container)
You pay for running code only
Fine controll over who can invoke the lambda and which services a lambda can invoke.

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

Amazon API Gateway

A

Create and publish APIs,
Tightly integrates with lambdas.
Can handle thousands of concurrent calls
Access controll, version management.

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

Amazon DynamoDB

A

Highly scalable, high performance, no sql
Scale on demand, virtually unlimited r/w, response time in a single-digit miliseconds.
With dax(?, cashe) you can have microseconds

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

AWS additional services

A

Amazon S3 - web service ( think of it as frontend)

Amazon SNS - simple notifocation service - publish/subscribe

Amazon SQS - multiple publishers and consumers

AWS Step functions - orchestrate lambda functions

Amazon Kinesis ( streaming data on real time)

Amazon Athena ( use standar sql syntax to retrieve)

AWS X-Ray - debug, Amazon CloudWatch - debug amd log

Amazon Cognito - user auth an management, openid ( also custom) etc.

AWS tools and SDKs - JS, Python, Java, go

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

Serverless most common use cases

A

Application backends
S3 as frontend
Real-time streaming data processing

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

CI/CD for serverless

A

AWS SAM ( lightweight of CloudFormation, AWS SAM Templates).

The Serverless Framework - open source, a bit different syntax, plugins.

AWS CodeCommit
AWS CodeBuild
AWS CodePipeline

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

Envirotment setup ( IAM etc)

A
An account
Sign to console
Set up a new user
AWS services, search iam
  User, cAdd user, name, access type, cNext 
Permissions

( programatic access will generate keys, no password, you can also check AWS management console access)

Attach existing policies directly (administrative for the learning purpose) cNext, cCreate
Download csv
Set up environment
  Key - value for credentials
  AWS_DEFAULT_REGION

Mac - in console

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

Environment setup (AWS cli)

A

Dowload installer

aws service command options