AWS Dev Jan 2022 Flashcards
What is a region?
A cluster of datacenters. Most AWS services are region-scoped.
How do you choose an AWS region?
- Compliance -data may need to be local to region.
- proximity - reduce latency for bulk of users.
- available services. does the region have that service?
- Pricing - varies region to region.
Availability Zones
Each region normally has 3 (6 is the max)
ap-southeast-2a
ap-southeast-2b
Altogether form a region.
Each AZ is one of more data centers with redundant power, networking and connectivity. They are isolated from disasters
IAM stand for?
Identity and access management - global service.
Create users in IAM
Can be grouped together if makes sense e.g. ‘developers’, ‘operations’
Can groups contain other groups?
No they can only contain users
A user can belong to multiple groups.
Users and groups can be assigned a JSOn doc called a policy.
Policy define permissions of user.
IAM policy consists of?
Version number
Statement
ID (optional)
SID (optional
Effect - to allow or deny
Principal who applied to
Action list of policies allows or denies
Resource what resources applies to
Password policy
prevent password reuse
MFA - if password is compromised can’t hack account
virtual MFA device - on one phone
authy - multi device
Password policy
prevent password reuse
MFA - if password is compromised can’t hack account
virtual MFA device - on one phone
authy - multi device
Universal 2nd factor (U2F) security key
support for multiple root and IAM users with single security key.
Hardware key fob MFA device
Hardware Key fob MFA Gov Cloud (US)
Cloudshell?
Terminal in AWS where CLI commands can be run from
Only available in some regions
IAM role
Intended to be used by AWS services
Assign permiisions to AWS servuce e.g.
EC2 instance (individual server) - may want to perform some action on AWS and need to give permission to EC2 instance. EC2 will use IAM role to access information from AWS and if permission is correct, will get access.
Lambda function role
Roles for CloudFormation
Security groups?
Control how traffic allowed into or out of EC2 instances.
Rules either via IP addresses or by other security groups.
Act as a firewall
Regulate access to ports, authorised IP ranges
Can be attached to multiple instances
Locked down to region/VPC combination
Live outside EC2
Time-out probs security group issue
‘Connection refused’ error - likely application error
by default all inbound traffic blocked/outbound traffic authorised
Ports
SSH port 22 - log into SSH on Linux
21 FTP
22 SFTP - upload files using SSH
90 - HTTP access unsecured sites
443 - HTTPS access secure sites
3389 - RDP log into Windows instance (Remote Desktop Protocol)
EBS
Network drive attach to instance whilst they run
persist data even after determination
‘network USB stick’
Locked to an AZ
Delete on termination - controls the EBS behaviour when the EC2 terminates
EBS Snapshots
Backup
Can restore it to another AZ
EBS snapshot archive (24 - 72 hours to restore)
Recycle bin -stored for about 1 year
Fast snapshot restore
AMI
Customisation of EC2 instance - owner software, configuration, monitoring tool.
Build own AMIs - build for specific region (can copy accross region)
Quick start-up as everything preconfigured
Public AMI - AWS provided
Own AMI
AWS MArketplace AMI
Start an EC2 instance, customise, stop instance for data integrity, build ami - creates EBS snapshots, launch instances from AMIs.
unique for each aws region
EC2 instance store
name of hard drive attached to server
emphemeral (if stop EC2 data will be lost)
Good for buffer/cache/scratch data
better I/O performance
EBS Volume types
size / throughput /io
EC2 only gp2/gp3 , ios1/ios2 boot volumes
gp2/gp3 low cost, effective storage, low latency
gp3 can independently set IOps and throughput but in gp2 they’re linked
provision IOPS - critical buiness application. sustained IOPS performance. Or apps that need more than 16000 IOPS
Good for database workloads.
Hard disk drive st1, sc1
cannot be boot volumne
sc1 for data infrequently accessed - low cost
root volumne - by default will be deleted on termination. other EBS volumne types not deleted as disabled by default
EBS IOPS peaks at 16,000 IOPS or equivalent 5334 GB.
EBS multi-attach
- up to 16 EC2 instances at a time
- higher avlaibility in clustered Linux applications (ex. Teradata)
- Multiple EC2 in same AZ
EFS
Managed NFS - mounted on many EC2 INSTANCES
works with EC2 in multi AZ
Highly avalible, expensive, pay per use
Only compatible with Linux based AMI (not windows)
CM, web serving, WP, data sharing
File system scales automatically
Mount same file system on instances in muti az
EFS
Big data - MAx IO for big data,
EFS -storage classes
storage tiers
standard - frequently accessed files
Infrequent access - pay to access, lower cost to store
standard - multi az
or for dev - one zone IA (low cost), backups by default
ebs vs efs
elastic block storage
only attach to one ec2 instance at a time
only on AZ
gp2 - io increases if disk size increases
io1 - increase IO independantly
Backups use IO so don’t run backup when app is busy
to migrate ebs to new az, take snapsot and restore snapshot to another az
root ebs volums terminated when instance is terminated (can adjust this setting)
network volumne that only mounted on one instance
efs
mounted to 100s of instances accross AZs
EFS share site files (WP)
Only for Linux (does not work for Windows)
higher cost than EBS
leverage EFS IA for cost savings
network file system accross multi instances