Mixed Flashcards
Iam
Identity federation PCI payment card industry Password rotation Temp access Multi factor authentication
Policies
Assigned to role, group or user
When a user created we get
Access key id
Secret access key
Password policy
Life cycle management
Complexity
True or false: Link to log in through iam is customizable?
True
Role
Can be assigned to an Iam user in another account
An aws resource
Application running on the resources
True or false: ec2 is region based
True
5 types of ec2 pricing models
On demand Reserved Spot Dedicated Saving plan
On demand ec2 pricing model
Pay per hour or sec depending on the instance
Reserved ec2 pricing model
1 or 3 years of prepaid and commitment
Called RI
For predictable load
RI, convertible RI and scheduled
Convertible RI vs RI vs Scheduled
Convertible you can change the power or type of ec2 as long as you are spending the same amount or higher
Scheduled, you scheduled for a certain time
Convertible up to 54% off
RI up to 72%
Spot ec2 pricing model
You bid on it and whenever it matches your bidded price, it assigns you the ec2
If you stop, you gotta pay for the resource, if aws stops you, you don’t pay for the rest of the hour
It’s for tasks that interruption doesn’t matter
Can be used for calcs, parallel computing
Up to 90% discount
Dedicated ec2 pricing model
License and compliance
On demand or reserved
Reserved up to 70% off
Saving plan pricing model
Not just for ec2
Not region based
Dedicated to 1 to 3 years and pay 72% percent off
You can change the type, the region,…
Ssh port
22
Http port
Port 80
True or false: Making ec2 we can decide what happens if we shut down the insurance. Shall it be terminated or stopped
True
Different types of ec2 instances
General purpose Micro Compute Optimized Fpga Gpu Machine learning Memory optimized Storage optimized
General Purpose instance
For general purposes, start with T1, T2
Micro insurance
Instance for testing or low i/o throughput and low network performance First 750 h is free for the first year 1 virtual cpu Less than one gig memory Cheapest Starts with m
Compute optimized instant type
Starts with C
It has the highest rate of Cpu to memory
Good for apps needed analysis and high performance apps
Fpga instance
Hardware accelerated instance
Good for parallel computing and finance
Starts with F
Gpu instance
Good for graphics
Starts with G
ImGe rendering and media processing
Machine learning instance
Good for machine learning, language processing
Uses ASIC (application specific integrated circuit)
Custom build cpu
Chip is called inference
Starts with Inf
Memory optimized instance type
Cheapest Ram per G
Starts with Z, X or R
For DB applications and memcache
Storage optimized insrance
Start with H, I or D Good apps need higher io or storage capacity I3 is good for nosql D3 is for warehouse Directly attach storage blocks to ec2
True or false: ebs is region based
True
Whats Ebs
Disk on the cloud
Availability zone sensitive
Replicate themselves into other zones, to avoid single point of failure
Different types of EBS
General purpose Provisioned iops Provisioned iops 2 Throughput optimized HHD Cold HHD Magnetic Storage
General purpose ebs
It’s for development or not latency sensitive
3 iops per g
Max iops 16000
Burst 3000 iops
Provisioned iops
SSD
50 iops per g
Max 64000 iops per g
Good for io intensive apps - DB or Io sensitive
Durability: 99.9%
Iops SSD 2 EBS
500 iops per G
64000 iops per G max
Higher durability 99.999%
HHD - throughout optimized ebs
Good for big data, data warehouse and log files Cannot be boot Good for Low frequency accessed data 40 mb per sec per T Burst 250 mb per sec per T Max 500 mb per sec per T
Cold HHD Ebs
Good for archive Can’t be boot The cheapest 12 mbs per T Burst 80 mbs per T Max 250mbs per T
True or false: encrypted EBS image is always encrypted
True
True or false: Changing ebs type or zone or adding a new ebs takes time time to take effect
False - it’s immediate and requires no down time
Different kind of load balancer
Application load balancer
Network load balancer
Classic load balancer
Application load balancer
Later 7
SSL / TLS level
Application aware
Routes the traffic to specific page
Network load balancer
Layer 4 Most expensive Routs TCP traffic pretty fast Can handle a mil per sec Fast speed used for extreme performance
Classic load balancer
Both layer 4 and 7 (x forward and sticky seasion)
Hard to debug 504 error. Which level is the error
Not as smart as other load balancer
How to find ip address when using load balancer
X-forwarded-for-header
What is 504 error
Means the gateway has timed out
Application is not responding within the timeout time
Https port
443
True or false: Load balancer target can be all Availability Zones
True
True or false: Adding roles to an instance or changing policies assigned to a role requires a reboot to take effect
No, no need to reboot. It takes effect immediately
What is Aurora?
Amazon relational DB
It doesn’t support free tier
OLAP VS OLTP
Olap is for extensive data analysis. Data warehouse.
Redshift is an olap
Oltp: for small frequent queries
Different kind of cache supported by elasticache
Memcache
Redis
Widely adapted memory object cache
Memcache
Which elasticache engine supports complicated data structures
Redis
Which elasticache engine supports multi az
Redis
Redis
Open source, in memory Key value Cache engine
It supports multi az, and data lists and other data types
Redis clusters are stateful entities
Memcache
Object caching system
Widely adapted
What elasticache engine to use if primary goal is object caching?
Memcache
What elasticache engine to use if primary goal is simplicity?
Memcache
What elasticache engine to use if primary goal is running large caching nodes and multi threaded performance?
Memcache
What elasticache engine to use if primary goal is expanding your cache horizontally?
Memcache
What elasticache engine to use if primary goal is using advanced data types?
Redis
What elasticache engine to use if primary goal is using leaderboards or sorting and ranking data sets?
Redis
What elasticache engine to use if primary goal is persistence of the key?
Redis
What elasticache engine to use if primary goal is running on multiple availability zones?
Redis
What elasticache engine to use if primary goal is having pub sub capability?
Redis
If DB is under stress and load is read only mostly what we should do to help?
Caching - elasticache
Def port for connecting to DB is
3306
To open RDS port to an ec2 what needs to be done?
Open inbound rules to ex2 sec group - port 3306
True or false: When RDS is created, you only get endpoint url not ip address
True
Rds backup types:
Automatic - by def on
Retention time is 0 to 35 days - def is 7 says
You can back up to any time of the day
When rds instance is deleted, backup is deleted
Back up being saved on S3 - free s3 with tge size of backup
Time of getting backup is changeable
Manual
Manually triggered
Doesn’t del the back up when rds instance deleted
How to restore from rds backup
Create a new instance from the backup. That gives you a new endpoint
True or false: you can encrypt an unencrypted rds instance
False - you have to get a snapshot, create a new instance and make that encrypted
How an rds instance get encrypted
At rest - using KMS
True or false: once an rds instance is encrypted, the backup (automated and manual) is encrypted too
True
Encryption at rest is supposed for what RDS types
Sql, mysql, Aurora, mariadb, postgres, oracle
Read replica vs elasti cache
Elasticache, data can get old, only available if it’s been seen before. While replica, data gets updates on replicas more frequently.
If you have many frequently changing dara, replica is better.
Difference between milti az and read replica for rds
Multi az is for disaster recovery
Read replica is for performance
Multi az is sync
Read replica is async
Multi az for rds
It means data is being replicated in different availability zones in case one fails the other takes over
Endpoint never changes but ip changes. That’s why we deal with endpoint
It can be turned kn from the beginning or when changing an rds instance
Read replica
We can have up to 5 replicas
Good for heavy read loads
Update happens async
We can have read replica of multi az
We can have multi az of read replica
Read replica can turn into a real db. If we have too many or need a copy of db
Not available for sql and oracle
Replicas can be in different regions and zones
Automatic back shall be on when using read replica
Read replica can be encrypted even if the main version of rds is not encrypted
Copies are read only
True or false: read replicas are read only
True
True or false: read replicas are only in one region and zone
False. Can be in multiple regions and zones
True or false: to have a read replica encrypted the main copy must be encrypted
False.
True or false: you must have auto backup on if want to have read replica in
True
How many read replica can we have
5
True or false: Multi az is for performance improvement of rds
False only for disaster recovery
True or false: read replicas get updated immediately
False- it happens async
Is s3 bucket object based or block based?
Object. Ebs is block based.
True or false: s3 is only used for objects not for os or db
True
True or false: high availability and disaster recovery is built in s3 bucket
True
S3 bucket file size range? And max size it can handle in one upload
0-5 t
5 g
Size range for Multi part upload for S3
5meg to 5 t
Recommend for over 100meg
Api response after successfully uploading a file into s3
200
True or false: s3 is not scaleable and has storage limit
False
It’s scalable and it has unlimited storage
S3 bucket, reading models
Eventually consistent- put (update) and del
Read after write consistent- put for new file
S3 availability and durability
Availability 99.9 guarantied built for 99.99
Durability 9.9 (11X)
Access control vs bucket policy
Access control- individual files
Bucket policy for the whole bucket
Different kinds of S3 bucket
S3 Durability 99.9 x11 Availability: 99.99
S3 IA - the same D A: 99.9 - paid retrieval
S3 one zone IA - Availability: 99.5 Durability the same - 20% cheaper
S3 glacier - archive - retrieval configurable mins to hours 99.99
S3 intelligent tiering - it decides based on 30 days frequency of access - same D, A: 99.9
.0025 usd for for managing a 1000 files
S3 deep archive glacier - min 12 h retrieval- the cheapest - A:99.99
Outposts - on premise local access
Redundancy reduced - when data can be retrieved easily
Charges involved with s3
Access requests Storage space Moving files Tagging - storage management Transfer acceleration
True or false: S3 can have access log and versioning enabled
True- you can see who called apis
We made a file public on s3 but still not accessible what can be wrong
You need to allow public access on policy
Encryption on S3
In transit - ssl tls transport layer
At rest
Aes 256 - Sse - aws is responsible for key management and protection
Kms - kms does the key management and generation
Sse-c client key is being used for encryption
Client side client does the encryption and send the data
S3 request header for encryption
X-amz-server-side-encryption
Expect in s3 bucket request
Don’t send the msg is header is rejected
What’s the s3 bucket url format
S3-region-amazonaws.com/ bucketname
What’s CORS
For cross origin resource sharing
When you want to give access of a resource in two different buckets
Under permission you need to give access to the website url - endpoint
Stops Cross scripting attack
S3 website url format
Bucketname-s3-website-region-amazonaws.com
Cdn vs content acceleration
Content acceleration uses cdn edges to expedite uploading files into s3 bucket
What’s cdn
Content delivery network
There are edges in different regions and zones
Edges are readable and writeable
Distribution is a group of edges
What’s distribution and how many types we have?
Group of edges
Web distribution for web content
Rtmp real time messaging protocols for steaming and adobe
True or false: we can have different resources per cdn edge
True - load balancer, ec2, s3, route 53 and tour own server
True or false: after activating cdn, you should remove direct access to the resource
True
What’s ttl and is it changeable
Ttl is expiration date for cdn content
You can manually request the edges to refresh the data, but costs you money
How many edges in how many countries
More than 100 in 25 counties
What to do if we want to have restricted access
Setup cdn to Use signed url - signed cookies
Can cdn have it’s own domain
Yes
Waf
Web firewall application
Works like firewall- application layer layer 7. Avoids sql injection and ddos
Block cross scripting attack
Blocking IP addresses
Cdn default and max ttp
24 h and 365 days
Whbe to optimize performance of s3 by cdn?
If more than 5500 get or 3500 put / list /del it’s time to use cdn to optimize
What’s lambda
Serverless computing service
What languages lambda supports
C# Java Go Python Node.js
Lambda pricing model
Requests: First 1 mil requests are free
After .20 per mil
Duration of execution - per G per secrounds up to 100ms
Example of serverless services
S3, lambda, dynamodb, api gateways
True or false: lambda is region-based but can work globally
True
True or false: Xray is for debugging lambda system
True
True or false: api gateway can have def url or custom
True
Does aws support ssl certificate
Yes, and it’s free
Does api connects to cloudwatch
Yes, to log calls and stuff
Does api gateway has caching?
Yes and ttl.
What security mechanisms can you use for api gateway
Aws Iam
Open
Open with key
Does api have versioning?
Yes it does. Latest label is for the last one.
True or false: after creating an api we need to deploy it
True
True or false: we can’t have versioning in lambda
False
Each version of lambda function has a label and a unique Arn.
True or false: lambda functions are immutable
True. Meaning any change must happen on new version
True or false: lambda functions can be run concurrently
True
There is a limit per account per region. 1000 per reg per acc
If you go over, 429 error is returned
Toomanyrequestsexception
You can go with reserved concurrency, but to make sure a function always get it’s own required number. Not a good idea though because it cannot go above that number
What’s reserved concurrency for lambda functions
It means we have a certain capacity out of 1000 assigned to a specific func to ensure it always runs. Not good cause it makes the function limited to that number
If we want to do ab testing on lambda what’s the process
We can’t use latest. We need ti create two versions and then name them with aliases then do ab testing
Lambda and vpc what do we need for setting up the connection
We need to setup eni (elastic network interface)
We need security group and private subnet ip
- - vpc-config subnetid=xyz,security-group=secgro
What is step In lambda
It’s used to trigger the function, log and visualize the info and what happens and it can do sequential, branching or parallel
What’s xray
It’s added to code for logging all interactions between resources, and logs all api calls and all responses to log all the info.
What do we need to integrate with xray on our server or system
Xray sdk and daemon
Sdk for gathering info and sending them to daemon
Daemon for queuing them and send batching them them back to aws
X-ray is configurable with what services?
Ex2 or on promises on ec2 or your system
Elastic Beanstalk - on ec2
Container - separate container is needed for xray
Annotations on logging
Extra data we can send along with a request. They are key pairs, can be used with filter expression to fund the data.
Can we import batch of Apis
Yes, apis are importable in case we are moving to aws
Can you change the max number of concurrent lambda functions?
Yes through support
How can you upload api file into aws
Swagger 2
Openapi v2 and v3
What’s the highest number of api call?
5000 concurrent
10000 per sec
If it goes over 428 error will be returned
What to do if we have old soap requests? For legacy systems
You can configure api gateway as a soap web service pass through
To creat a new api what’s the api call
Post - with swagger in payload - and endpoint configs
What’s the api call for updating / replacing
Put api and swagger in the payload.
Mode query param, You can decide if you want to replace or update existing api.
What’s dynamo db
Fast and flexible nosql db
Where do the dynamo db collections sit?
Ssd
How dynamo db avoids single point of failure?
The underlying hardware supporting dynamo is speared through 3 regions
What are dynamo db consistency model?
Strongly consistent
Eventually consistent - consistency reaches within a sec - good for read performance
Different types of primary key in dynamo db
Partition key - hash func to define physical partition
Composite key - partition key and sort key
How to control access on dynamo db
Iam role
Iam condition to give partial access to the table
LeadingKeys param is used