Merge 1 Flashcards
AWS Global Infrastructure consists of…
- Regions2. Availability Zones3. Edge Locations
What is a Region?
A Region is a geographical area.
What is an Availability Zone?
An Availability Zone (AZ) is simply a data center.
What is an Edge Location?
Edge locations are CDN endpoints for CloudFront.
Why are AZs isolated/independent from one another?
E.g. in case there is a flood in one, the other won’t be affected. Low latency between each AZ.
VPC
Virtual data center
Route53
DNS service
CloudFront
CDN - edge locations to cache files
Direct Connect
connect physical datacenter to AWS directly using a dedicated phone line
Use Direct Connect when…
…you need a very reliable internet connection for pushing lots of data to AWS or down from AWS
EC2
virtual machines in cloud
Elastic Beanstalk
deploy code to AWS, AWS provisions infrastructure
Lambda
upload code, code will respond to events
S3
Virtual disk in the cloud where you can store objects (files). Don’t use to store DBs or OSs or apps
Glacier
Archive files from S3
EFS (Elastic File Service)
Block-based storage that you can share (can install DBs, apps, etc)
Storage Gateway
Virtual machine that connects S3 to your on-premises datacenter
RDS
relational database service
DynamoDB
nonrelational database
RedShift
data warehousing
Elasticache
cache data in cloud (takes load off of database)
Snowball
move terabytes of data into cloud
DMS
migrate on-premise database to the cloud, migrate databases inside AWS to other regions or services. no down time, can convert databases
EMR
big data processing. know what it is and how to access it
Kinesis
streaming and analyzing real-time data at massive scale
Cloud Search/Elastic Search
if you need to create search capabilities for website
Data Pipeline
move data from one place to another
IAM
sign in, authenticate, manage users and permissions
Inspector
agent installed on VMs, inspects and reports on security
Certificate Manager
free SSL certificate for domains
Directory Service
Using Active Directory, connects active directory to AWS
WAF
give application-level protection to your website
Artifacts
compliance documentation in AWS console
CloudWatch
monitor performance
CloudFormation
document that turn infrastructure into code
CloudTrail
audits AWS resources
Opsworks
automates deployments using Chef
Config
monitors/audits environment, can set alerts based on compliance
Trusted Advisor
automated way of scanning environment, giving security tips
SWF
coordinating automated and human tasks
API Gateway
door for apps to access backend data
Elastic Transcoder
Changes video format to suitable devices
CodeCommit
GitHub
CodeBuild
compile code
CodeDeploy
deploys code to EC2 instances
CodePipeline
keep track of all versions of code
Mobile Hub
design mobile apps
Cognito
sign in w/ Identity Federation
Device Farm
mobile testing
Mobile Analytics
analyze mobile data
WorkSpaces
have desktop in cloud
SNS
task notification
SQS
queue system to decouple apps
SES
send/receive emails
AWS Global Infrastructure consists of…
Regions, Availability Zones, Edge Locations
What is a Region?
A Region is a geographical area. Each Region consists of 2 or more Availability Zones.
What is an Availability Zone?
An Availability Zone (AZ) is simply a data center.
What are Availability Zones, physically?
They are facilities that are close to each other but not dependent on one another. For example, one AZ in Manhattan, another in New Jersey.
Why are AZs isolated/independent from one another?
E.g. in case there is a flood in one (e.g. Manhattan), the other (NJ) won’t be affected.
T/F: There is low latency between 2 AZs in the same region.
TRUE
What is an Edge Location?
Edge locations are CDN endpoints for CloudFront.
What is an example of what CDN used for?
To cache large media files in the cloud. Example: if I am a user in NY and if I want to download a video hosted in Australia, the first time, the video has to travel to the edge location in NY prior to downloading. Next time, the video would be cached at the NY edge location.
Think of VPC as…
…a logical datacenter.
Where do you deploy a VPC?
Region
T/F: VPCs can span regions.
FALSE
T/F: VPCs can span Availability Zones.
TRUE
According to the AWS definition, what does Amazon VPC allow you to provision?
Amazon VPC lets you provision a logically isolated section of the AWS cloud where you can launch AWS resources in a virtual network that you define.
According to the AWS definition, how much control do you have over your networking environment?
You have complete control over your virtual networking environment, including selection of your own IP address range, creation of subnets, and configuration of route tables and network gateways.
T/F: You can easily customize the network configuration for your Amazon VPC.
TRUE
What is an example of how you can customize the network configuration for VPC?
Create a public-facing subnet for your webservers that has access to the Internet, and place your backend systems (e.g. databases, application servers) in a private-facing subnet with no internet access
You can leverage multiple layers of security, including…
…security groups and Network ACLs to help control access to EC2 instances in each subnet.
T/F: You can create a Hardware VPN connection between your corporate datacenter and your VPC and leverage the AWS cloud as an extension of your corporate datacenter.
TRUE
Private IP address ranges
- 10.0.0.0-10.255.255.255 (10/8 prefix)
- 172.16.0.0-172.31.255.255 (172.16/12 prefix)
- 192.168.0.0-192.168.255.255 (192.168/16 prefix)
Maximum addressable size in AWS
/16
What are the two routes of entry into VPC?
Internet Gateway, Virtual Private Gateway
What is the purpose of the Internet Gateway?
Allows you to connect to the Internet
What is the purpose of the Virtual Private Gateway?
Allows you to terminate VPN connections
What is the purpose of the Router?
It routes traffic based on what is defined in the route tables
What is a Public subnet?
Internet-accessible subnet
What is a Private subnet?
Not Internet-accessible subnet
What do you normally put in public subnets?
Webservers, bastion host
What do you normally put in private subnets?
Database servers, application servers
Can security groups span subnets or availability zones?
Yes
Can network ACLs span subnets or availability zones?
Yes
How many subnets per availability zone?
One
Can route tables span subnets or availability zones?
Yes
Can a subnet span multiple availability zones?
No
What can you do with a VPC?
- Launch instances into a subnet of your choosing
- Assign custom IP address ranges in each subnet
- Configure route tables between subnets
- Create internet gateway and attach it to our VPC
- Much better security control over your AWS resources
- Instance security groups
- Subnet network access control lists (ACLs)
What does a route table define?
Whether a subnet is public or private
How many internet gateways can you have per VPC?
One
Example question: if Internet connection is running slow, how can you boost Internet speed?
If one of the answers is “attach another IGW to the VPC,” DON’T PICK THAT ONE!
T/F: Security groups are stateful.
TRUE
What does “stateful” mean?
If you create a rule allowing traffic in, it automatically allows traffic out.
T/F: Network ACLs are stateless.
TRUE
What does “stateless” mean?
If you create a rule allowing traffic in, you need to create a rule allowing the traffic back out.
Default VPC properties:
- User friendly, allowing you to immediately deploy instances
- All subnets in default VPC have a route out to the internet
- Each EC2 instance has both a public and private IP address
- If you delete the default VPC the only way to get it back is to contact AWS.
What does VPC Peering allow you to do?
Allows you to connect one VPC with another via a direct network route using private IP addresses
Example: VPC Peering Use Case
Connect: VPC for monitoring services, VPC for Active Directory, Administration VPC, Production VPC, Dev VPC, Test VPC
T/F: When VPC Peering, instances behave as if they were on the same private network
TRUE
T/F: You can peer VPCs with other AWS accounts as well as with other VPCs in the same account.
TRUE
Example: peer VPCs with other accounts use case
Peer VPCs with Dev account, Test account, Production account
What is the configuration of VPC Peering?
Star configuration (1 central VPC peers with 4 other VPCs)
T/F: Transitive peering is allowed.
FALSE
What does a VPC consist of?
- IGWs (or Virtual Private Gateways)
- Route Tables
- Network Access Control Lists
- Subnets
- Security Groups
You have a business-to-business web application running in a VPC consisting of an Elastic Load Balancer (ELB), web servers, application servers and a database. Your web application should only accept traffic from predefined customer IP addresses. Which two options meet this security requirement? Choose 2 answers
A> Configure web server VPC security groups to allow traffic from your customers’ IPs
B> Configure your web servers to filter traffic based on the ELB’s “X-forwarded-for” header
C> Configure ELB security groups to allow traffic from your customers’ IPs and deny all outbound traffic
D> Configure a VPC NACL to allow web traffic from your customers’ IPs and deny all outbound traffic
A> Configure web server VPC security groups to allow traffic from your customers’ IPs
B> Configure your web servers to filter traffic based on the ELB’s “X-forwarded-for” header
A is obviously correct as security group can be configured to accept traffic from predefined customer IPs
You can leverage AWS WAF to configure your webserver and filter the traffic based of HTTP header passed by load balancer. Hence #B is correct
The security group can be configured to only allow the inbound or outbound traffic. When you allow certain inbound traffic in security group, the outbound traffic is automatically allowed because of the stateful nature. Hence #C is wrong
In case if you deny all outbound traffic in NACL it will accept the inbound traffic but outbound hence #D is wrong.
In the VPC Lab it states that AWS won’t allow you to use more than /16 on a VPC. But then later on when you go to the ‘Create Subnet’ wizard, in the demo you entered 10.0.1.0/24. So why can you now exceed the /16?
This can be summed up quite simply. The /16 or /24 is the number of mask bits in the CIDR address. The 16 signifies that should mask the first two octets. Leaving two additional octets for addressing needs. Each octet contains 255 addresses. Therefore a mask of /16 is 255 X 255 addresses or 65535.A /24 address is only masking 8 bits or 255 addresses. So in essense a mask of /16 is a lot more than a mask of /24.
Can a vpc of any size be created?
a) amazon vpc supports vpcs from /16 to /28 (in cidr)
b) there is no size limit
c) amazon vpc supports vpcs with any subnet smaller than /16
d) amazon vpc supports vpcs with any subnet greater than /28
a)amazon vpc supports vpcs from /16 to /28(in cidr)
which of the following is true about route table in vpc (multiple)
a) main route table is created along with with vpc
b) the main route table can be replaced with a custom route table
c) route tables are automatically created and cannot be edited
d) a subnet can exist without association with route table .
a)main route table is created along with with vpcb)the main route table can be replaced with a custom route tableExplanations:
A is correct, as per AWS doc: “When you create a VPC, it automatically has a main route table.”
B is correct, as per AWS doc: “You cannot delete the main route table, but you can replace the main route table with a custom table that you’ve created”
C is totally wrong
D is wrong, as per AWS doc: “Each subnet must be associated with a route table, which controls the routing for the subnet. If you don’t explicitly associate a subnet with a particular route table, the subnet is implicitly associated with the main route table.”
Through the training I was continuously told that Security Groups are stateful, and any rule created inbound is automatically created outbound. However, upon going through the Wordpress portion of the training, you create a Security Group and I see a Outbound Rules tab. So now I’m confused, did Security Groups change since they released the training or am I confusing it with something else?
The outbound tab is relevant where traffic originates from within the security group, whereas inbound rules are relevant from traffic originating from clients outside the security group.Taking your wordpress site example, assuming it is deployed on an instance secured by a security group for inbound traffic, say from a web browser you would want http 80 and https 443 open on inbound part of the security group whereas for Wordpress to pull updates to plugins you would want http 80 open on the outbound portion of the security group so it can poll remote plugin sites (either directly or via a nat). By default, there are no restrictions on outbound traffic, but if you wanted to limit the way in which your instance could reach out to the internet the this is one area in which you could do it.
I’m in the middle of preparing for my Architect Associate exam and I have a question on VPC. I’ve created an exercise for myself where the following infrastructure should be created:
2 Frontend servers with an Apache HTTP server
2 Backend servers with Tomcat (and a simple web application that allows you to upload files to S3).
I’m a bit “stuck” on the VPC configuration, where I had the following in mind:
- Create 4 subnets, 1 for each server. Not per se to assign 1 subnet per server, but more to spread them throughout the availability zones.
- Add a Load Balancer between Frontend and Backend servers to divide the load between the
2.I know you can go a lot further than that, but the main idea is to tinker a bit with VPC stuff, not to provide a small enterprise with a full blown infrastructure. The reason why I would create 4 different subnets is to provide high availability, since you can put your EC2 instances in different availability zones. But is that reasoning correct? Or are there better ways of handling that problem.
Your approach to achieve HA for the use case you have described is ideal. if you wanted to take it a step further I’d also add an auto-scaling group so that if an instance dies in an AZ the auto-scaling group will recover it, but you’ll discover that anyway as you go through the course.Given you want to load-balance the backend instances, you have to think about which subnet(s) you’ll be launching them into, and here are 2 possible ways I have seen done:
1 - launch them into the frontend subnets; give the frontend instances access to hit the LBs via the LB security group, and give the LBs access to the backend instances via the backend’s SG.
2 - have another pair of subnets just for the LBs, and again do something similar with the SGs. You’ll need to adjust your route tables in order to put these new subnets in-between the other 2 sets. This of course presumes your VPC has enough spare IPs to allow for more subnets.
Similar to 1, it is possible to launch the LBs into the backend subnets. Usually it depends on which subnets you have room free for the LBs. Don’t forget to lock everything down security-wise with your SGs and network ACLs.
amazon gurantees hardware isolation in vpc , is this true
a) yes but only dedicated placement option which is seperately billable
b) no guarantee that hardware will be shared by another account
c) yes it comes free with vpc
d) yes but only with virtual private gateway feature
a) yes but only dedicated placement option which is seperately billable
What is VPC Peering?
VPC peering is simply a connection between two VPCs that enables you to route traffic between them using private IP addresses.
For VPC Peering, instances in either VPC can communicate with each other…
…as if they are within the same network.
How can you create a VPC peering connection?
between your own VPCs, or with a VPC in another AWS account within a single region
How does AWS create a VPC peering connection?
AWS uses the existing infrastructure of a VPC
T/F: VPC Peering connections are gateways.
FALSE
T/F: VPC Peering connections are VPN connections.
FALSE
Does VPC Peering rely on a single piece of hardware?
No
Is there a single point of failure for communication or a bandwidth bottleneck?
No
T/F: VPC peering can occur between VPCs in different regions.
False; VPC peering must occur between VPCs within a single region.
Example: If VPC A and VPC B were peered, and VPC A’s CIDR = 10.0.0.0/16 and VPC B’s CIDR = 10.0.0.0/24, what will happen to the connection?
It will not work since VPCs with matching or overlapping CIDRs cannot be peered.
Transitive Peering…
…is NOT supported!
How to create a VPC with public and private subnets:
- Create VPC, which creates a main route table, default security group, and default network ACL.
- Create 2 subnets.
- Create and attach an IGW to the VPC.
- Create another route table.
- Associate the IGW and one of the subnets to the custom route table.
- Launch instance in the public subnet with a security group allowing HTTP, HTTPS, SSH.
- Launch instance in the private subnet with a security group allowing SSH, ICMP, .
- Launch NAT instance or create NAT gateway or Bastion.
- Create Network ACL mirroring security groups
What is the purpose of the CIDR block?
Specifies IP address ranges
What size can the CIDR be for a VPC or subnet?
Between /16 and /28
What is meant by “Tenancy?”
Determines whether VPC and its assets are deployed onto shared hardware or dedicated hardware. Default is shared hardware.
When would you want the Tenancy to be Dedicated?
Security concerns, e.g. regulatory requirements
When you create a VPC, what else is created?
Main route table, default security group, default network ACL
When you create a VPC, what is NOT created?
Subnets, Internet Gateway
Can a subnet be the same size as your VPC?
Yes
1 subnet always equals
1 Availability Zone
To make a subnet public…
…create and attach an Internet Gateway, associate it with a route table, and associate the subnet with that route table. Additionally, enable auto-assign IP on that subnet.
When you create a new subnet, is it associated with any route tables?
Yes, it will be associated with the main route table by default
Why is it considered a best practice to keep the main route table private?
If there is a route out to the Internet from the main route table, all subnets in that route table will automatically be public, which is a security risk.
If you forget to enable auto-assign public IP for a subnet…
…when you launch an EC2 instance you can enable auto-assign there.
If you forget to assign a public IP address to a public EC2 instance…
…you can allocate an Elastic IP address to it
When you launch an instance in the private subnet…
…traffic will be sourced from the public subnet.
To SSH into your private instance from your public instance…
…you need to copy/paste your keypair into the public instance and chmod 600
To be able to PING the private instance…
…allow ICMP on the private instance and ping the private IP from the public instance
To perform security patches, install software, etc on a private instance…
…you need a way for that instance to access the Internet (NAT instance or NAT gateway)
To allow private instances to access the internet…
…use a NAT instance or a NAT gateway and allow a route out from the private route table > NAT > Internet.
To launch a NAT instance…
…search “nat” in the Community AMIs
After NAT instance is launched…
…disable Source/Dest check
In which subnet should the NAT instance or NAT gateway be deployed?
Public subnet
Is a security group required for a NAT instance?
Yes
Is a security group required for a NAT gateway?
No
What happens when you create a NAT gateway?
You create an Elastic IP since it is required to create one or use an existing one. In addition, a message pops up that explains that you need to edit your main route table to include a route with a target = NAT gatway.
What is meant by Source/Dest check?
By default, EC2 instances are either the source or destination of any traffic, and traffic does not go through an EC2 instance.
What happens if the NAT instance goes down, or its availability zone goes down?
The NAT instance is a single point of failure, so you will lose any internet access to everything in the private subnet.
To prevent a NAT instance from going down…
…set it behind an Auto Scaling group, set min number = 1, or use multiple public subnets and deploy NAT instances in each
With NAT gateways, do you need Auto Scaling?
No
When a NAT instance’s bandwidth is used up (bottlenecked), what do you do?
Increase the instance size, change instance family so you can support more traffic
T/F: When you deploy a NAT instance, you must assign a public IP address.
TRUE
To create high availability with NAT instances…
…use Auto Scaling Groups, multiple subnets in different AZs, and a script to automate failover.
Can subnets/availability zones span multiple Network ACLs?
No, but the reverse is possible.
What traffic does the default Network ACL allow?
All traffic inbound and outbound.
What traffic does a new Network ACL allow?
No traffic inbound or outbound.
When you create a standard Network ACL for connecting to the Internet, why might it not connect right away?
You will need another rule that opens up ephemeral ports in order to cover the different types of clients that might initiate traffic to the public-facing instances in your VPC
T/F: Each subnet in your VPC must be associated with a network ACL.
TRUE
If you don’t explicitly associate a subnet with a network ACL…
…the subnet is automatically associated with the default network ACL
When you associate a network ACL with a subnet…
…the previous association is removed.
How are the rules in a Network ACL evaluated?
Numerical order starting with the lowest number
When blocking specific IPs…
…use network ACLs not security groups
If I have multiple VPCs created, may I use the same CIDR block, i.e. 10.0.0.0/16 for each VPC?
If there’s no peering needed
Several questions indicate that in order to make an EC2 instance in a non-default/private subnet, 2-way internet accessible you need to add an elastic IP. Is that because the instance is already running and that’s the only way to add a public IP to a running instance? Specifying “Auto-assign Public IP” at launch time has the same effect, correct?
You can assign and unassign IPv4 and IPv6 IP addresses on each network interface. Leave the IP address field blank and an available address will be assigned or enter an IP address that you want to assign. To add or edit an IPv4 public IP Allocate an Elastic IP to this instance or network interface.Yes I think so ! Elastic IP’s can be allocate to an Private Instance through the Manage IP section even after the Instance is up and running
In this lecture to access the DB server from the jump host you are copying the private key on to the bastion host. Which is not a safe practice as publicly accessible jump hosts are the first ones to be hacked.Is there a better way of doing this, like using a combination of IAM role and instance metadata, which gives temporary credentials to access other AWS services?
There is a better way indeed. If you connect to the first host with -A, it enables SSH Key forwarding, and your local ssh key will be used to connect to the second host
To use an ELB in a custom VPC…
…you need two public subnets to make it highly available
NAT vs Bastion
NAT: routes traffic from Internet to EC2 instances in private subnets and is Linux, so can SSH but cannot RDP
Bastion: used to securely administer EC2 instances using SSH/RDP in private subnets
Bastion use case
Administration only
Scenario: how to make a bastion instance highly available?
Need multiple public subnets. can have a bastion in each public subnet. implement Autoscaling groups
Bastion example
Think of the webserver created in the lab, where we ssh into public and then private instance
Can you delete a VPC while EC2 instances are active?
No
Can you delete a VPC while ELBs are active?
No
Why do you delete a NAT gateway before deleting a VPC?
NAT gateways take a while to delete and they are a dependency
Think of VPC as…
…a logical datacenter in AWS
1 Subnet =
1 AZ
Security Groups are…
…stateful
Network ACLs are…
…stateless
Can you peer VPCs in same account?
Yes
Can you peer VPCs in different accounts?
Yes
Transitive peering?
No
When creating a NAT instance…
…disable Source/Destination Check on the instance
NAT instances must be in which subnet?
Public
For NAT instance to work…
…must have elastic IP address, must be a route out of the private subnet to the NAT instance
How much traffic do NAT instances support?
Depends on the instance size. If bottlenecking, increase the instance size
You can create high availability using…
…AutoScaling Groups, multiple subnets in different AZs, a script to automate failover
T/F: NAT instances are behind a security group.
TRUE
NAT gateways…
…scale automatically up to 10 Gbps, no need to patch, not associated with security groups, automatically assigned a public IP, do not need to disable source/dest check
Default NACL…
…automatically created with a VPC and by default it allows all inbound and outbound traffic
Custom NACL…
…denies all inbound and outbound traffic until you add rules
T/F: Each subnet in your VPC must be associated with a network ACL
TRUE
If you don’t explicitly associate a subnet with a network ACL…
…the subnet is automatically associated w/ default network ACL
Can you associate a network ACL with multiple subnets?
Yes, but a subnet can only be associated with one NACL at a time
When you associate a network ACL with a subnet…
…the previous association is removed
NACL rules…
…evaluated in order, starting with the lowest numbered rule
NACL inbound and outbound rules are…
…separate. Each rule can either allow or deny traffic
NACLs are stateless, so…
…responses to allowed inbound traffic are subject to the rules of outbound traffic (and vice versa)
Block IP addresses using…
…NACLs not Security Groups
A NAT is used to…
…provide internet traffic to EC2 instances in private subnets
A Bastion is used to…
…securely administer EC2 instances using SSH or RDP in private subnets