TowardsAWS Cheat Sheet Flashcards
Virtual Private Cloud (VPC) and Networking
VPCs can span multiple availability zones in a single region and can contain several public and private subnets
A public subnet contains a route to an internet gateway (which you need to set up)
A private subnet has in general no internet access.
If this is needed, you need to maintain a NAT Gateway or Instance and also whitelist traffic to those.
If you need SSH access from the internet to a resource in a private subnet you need to set up a bastion host on a public subnet and configure your Security Groups and Network Access Control lists accordingly for forwarding traffic on port 22
Disaster Recovery Plans
Backup and Restore
Self describing; has highest RTO and RPO but lowest cost
Pilot Light
Storing critical systems as a template from which resources can be scaled out in the event of a disaster.
With this, you replicate your data from one Region to another and provision a copy of your core workload infrastructure.
Resources required to support data replication and backup, such as databases and object storage are always on.
Other elements such as application servers are loaded with application code and configurations but are switched off and are only used during testing or when DR failover is invoked.
Pilot Light approach minimizes the ongoing cost of DR by minimizing the active resources, and simplifies recovery at the time of a disaster because the core infrastructure requirements are all in place
Warm Standby
A duplicate version of only your business critical systems that are always running, in case you need to divert workloads to them in the event of a disaster
This approach ensures there is a scaled down but fully functional copy of your production environment in another Region.
This approach extends the pilot light concept and decreases the time to recovery because your workload is always on in another Region
Multi Site
Self describing; lowest RTO and RPO but highest cost
This is a one for one replication of your production environment.
It is truly fault tolerant
Recovery Time Objective
Time needed to bring services back online after a major incident
Recovery Point Objective
The data loss measured in time
Route Tables
Rules how traffic can flow within your VPC
Always contains a destination and a target e.g. 0.0.0.0/0 (CIDR Destination) and igw-1234567890. The CIDR block contains all IPv4 addresses of the subnet and points them to the Internet Gateway.
Attached to certain subnets
There is a default route table (main route table) which will be associated with each newly created subnet as long as you dont attach one by yourself
The main route table cant be deleted
You can add, modify and remove routes in this table
One subnet can only have one route table
The same route table can be attached to multiple subnets
Route tables can also be attached to your Virtual Private Gateway or Internet Gateway so you can define how traffic entering your VPC will be routed
You VPC always has an implicit router to which your route tables will be attached to
Virtual Private Gateway (VPC Gateway)
Needed if you want to connect your AWS VPC with an on premise Network
Network Access Control List
operating on the subnet level and are stateless
they can define block and allow rules
by default allow traffic for all ports in both directions
return traffic must be explicitly allowed
Security Groups
Operating on the instance level and are stateful
They only define only allow rules
The default security group allows communication of components within the security group, allow all outgoing traffic and block all incoming traffic
return traffic is implicitly allowed
SGs can be attached or removed from EC2 instances at any time (state of machine does not need to be stopped or terminated)
Rules always need to specify CIDR ranges and never a single IP
If you want to have a dedicated IP, you also need to define it as a CIDR range only covering a single IP by its subnet mask (/32)
VPC Endpoints
needed to access AWS servcies which are not part of your VPC
There are different types such as Gateway Endpoint which is for DynamoDB and S3 and Interface Endpoint which is for all other services and are powered by AWS PrivateLink
NAT Gateway & Instance
Needed to connect to the public internet from your private subnets
There are two dfferent types:
NAT Instance - managed by the user with no default auto scaling
NAT Gateway - AWS managed gateway, scales based on demand, fewer administrations required, and higher availability compared to the NAT instance
VPC Peering
VPC peering connection is a networking connection between two VPCs that enables you to route traffic between them using private IPv4 addresses or IPv6 addresses
Instances in either VPC can communicate with each other as if they are within the same network
Also possible to connect with VPCs of other accounts