AWS Final
AWS Final
Chapter Topics
Global Infrastructure A Conceptual Introduction to Amazon Web Services (AWS)
Regions
Availability Zones
End points
Creating an AWS Account Usage Tracking Billing
IAM IAM Essentials
IAM Policies
IAM Users
IAM Groups
IAM Roles
Cloud Watch Alarms
Events
Monitoring
Logging
AWS Simple Notification Introduction to SNS
Service SNS
CloudTrail Understanding the concepts CloudTrail
VPC Basic understanding of VPC
Subnets
Route Table
Internet Gateway
NAT Gateway
Security in VPC: NACL
VPC Peering
VPC Endpoints
Limitation of VPC
Server Based Compute EC2 Architecture, Instance, Types and Sizes
(EC2) Fundamentals EC2 instance purchasing types
Instance Roles
AMI’s
Ec2 Storage Architecture
EBS, Types
EFS
Overview of Different types of storage classes
Snapshots
Life cycle manager
Security Groups
Elastic IPs
Key pairs
Load Balancing
Autoscaling
Route 53
Chapter Topics
S3 Understanding S3
S3 Naming Convention
Transferring Data to S3
Storage classes in S3
Lifecycle policy in S3
Cost optimization for S3
Versioning in S3
Encryption in S3
Static website and CORS
(1)
GLOBAL INFRASTRUCTURE
Billing dashboard go to preferences and enable the receive free tier usage alert
2. Global infrastructure
We can access AWS i) AWS console ii) AWS cli iii) SDKs
3. AWS Region:
● AWS Region is a separate geographic area where we cluster data centers.
● Each AWS Region is completely independent.
Availability zones: Each AWS Region consists of multiple, isolated, and physically separate AZs
within a geographic area.
4.
Compute section:
5. Storage overview:
Databases: SQL Database - RDS, NOSQL Database - DynamoDB, Elastic cache, Redshift.
Storage: AWS S3 object storage service file used in application storing file and retrieving files.
(2)
IAM (Identity and Access Management)
● IAM provides access to accounts services where we can manage User, Roles, Groups & Policy
password policy.
● It applies globally to all AWS regions.
Users: we create users and assign necessary permissions to them in the form of policies.
Groups: We can create groups for ex. Dev QA etc. and attach policies at the group level.
Policy:
A policy is a set of permission
Always explicit deny overrides explicit allow
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": *,
"Resource": "*"
},
Policy types:
Imp Notes:
More than one policy can be attached to a user or a group at the same time.
Policies can’t be attached directly to resources like EC2 instance, S3 bucket etc.,
Ex:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "FirstStatement",
"Effect": "Allow",
"Action": ["iam:ChangePassword"],
"Resource": "*"
},
{
"Sid": "SecondStatement",
"Effect": "Allow",
"Action": "s3:ListAllMyBuckets",
"Resource": "*"
},
]
}
Roles: A role is a set of permissions that grant access to actions and resources in AWS.
Roles comes between services, like ec2 wants to access S3 or non-AWS user (hybrid account)
should access AWS Resources.
Policies can’t be attached to aws resources hence roles come into picture.
EC2 can be attached one role at a time.
Can we assign multiple roles to a EC2 instance? No, we can’t. we can assign only single role to
EC2 instance.
Q: If an ec2 instance is not able to access s3 bucket what could be the reason
A Role needs to be attached with proper policy defined.
Assume Role:
Returns a set of temporary security credentials that you can use to access AWS resources that
you might not normally have access to. These temporary credentials consist of an access key ID, a
secret access key, and a security token.
The AWS Security Token Service (STS) is a web service that enables you to request temporary,
limited-privilege credentials for AWS Identity and Access Management (IAM) users or for users that
you authenticate (federated users).
(3)
CloudWatch
Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the applications you
run on AWS in real time
Metrics:
Metrics are data about the performance of your systems
Basic monitoring: which polls for every 5 minutes
Detailed monitoring: which polls for every 1 minute.
Alarm:
CloudWatch Alarms feature allows you to watch CloudWatch metrics and to receive notifications when
the metrics fall outside of the levels (high or low thresholds) that you configure
Ex:
If CPU utilization goes beyond the static threshold alarm goes to alarm state
Three states in CW Alarm:
Alarm state
Insufficient
OK state
Logs:
CloudWatch Logs enables you to centralize the logs from all your systems, applications, and AWS
services
(4)
Simple Notification Service
Amazon Simple Notification Service is a notification service provided as part of Amazon Web
Service.
It provides a low-cost infrastructure for the mass delivery of messages, predominantly to mobile
users
Topic:
An Amazon SNS topic is a logical access point that acts as a communication channel
(5)
CloudTrail
Amazon Virtual Private Cloud (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 like EC2
instance Databases.
CIDR:(Classes interdomain routing)
Classless Inter-Domain Routing is a method for allocating IP addresses and for IP routing.
VPC design:
VPC CIDR = 10.180.0.0/16 means we have 65536 IPv4 address
IPV4 Address range is 10.180.0.0 ---- 10.180.255.255
Public subnet 1 Public Subnet 2 Private Subnet 1 Private Subnet 2
10.180.0.0/24 10.180.1.0/24 10.180.2.0/24 10.180.3.0/24
256 IPV4 address 256 IPV4 address 256 IPV4 address 256 IPV4 address
10.180.0.0-10.180.0.255 10.180.1.0-10.180.1.255 10.180.2.0– 10.180.2.155 10.180.1.0 – 10.180.3.255
A subnet is a range of IP addresses in your VPC. You can launch AWS resources into a specified
subnet.
Some IP addresses are reserved they are
10.180.0.0 Network address
10.180.0.1 VPC Router
10.180.0.2 DNS server (DNS. (Domain Name System) The Internet's system for
converting alphabetic names into numeric IP addresses)
10.180.0.3 Future use
10.180.0.255 N/W Broadcast address
VPC spans multiple Availability zones.
Subnets must be associated with route table
A public subnet has a route to internet
A private subnet doesn’t have route to internet. It creates higher level of security.
You can use a network address translation (NAT) gateway to enable instances in a private subnet
to connect to the internet or other AWS services, but prevent the internet from initiating a
connection with those instances.
VPC Peering:
A 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.
You can create a VPC peering connection between your own VPCs, or with a VPC in another AWS
account.
The VPCs can be in different regions (also known as an inter-region VPC peering connection).
Conditions:
CIDR block shouldn’t overlap
Transitive peering relationships are not supported. i.e here VPC B cannot connect with VPC C.
If the VPCs are in different regions, inter-region data transfer costs apply.
You cannot have more than one VPC peering connection between the same two VPCs at the same
time.
NACL:
1. A network access control list (ACL) is an optional layer of security for your VPC that acts as
a firewall for controlling traffic in and out of one or more subnets. (Firewall at subnet level)
1. Inbound means – incoming (Ingress)
2. Outbound means – outgoing (egress)
3. Always explicit deny take precedence over allow
Security Group:
A security group acts as a virtual firewall for your instance to control inbound and outbound
traffic.
Natgateway:
A NAT gateway is a Network Address Translation (NAT) service. You can use a NAT gateway so that
instances in a private subnet can connect to services outside your VPC, but external services cannot
initiate a connection with those instances.
Bastionhost:
A bastion host is a server whose purpose is to provide access to a private network from an external
network.
VPN:
Is mainly used to establish a secure and private tunnel from you network or device to aws network
Aws site-to-site vpn: enables you to securely connect your on-premises network to your vpc.
AWS client vpn : enables you to securely connect users to AWS or on premises network.
6)
Elastic Cloud Compute
EFS:
Amazon Elastic file system is a regional service storing data within and across multiple
Availability Zones (AZs) for high availability and durability
Snapshot EBS
You can back up the data on your Amazon EBS volumes to Amazon S3 by taking point-in-
time snapshots. Snapshots are incremental backups
An AMI is a template that contains the software configuration (operating system, application
server, and applications) required to launch your instance.
You can launch multiple instances from a single AMI when you need multiple instances with
the same configuration.
An EBS snapshot is a backup of a single EBS volume. The EBS snapshot contains all the data stored
on the EBS volume at the time the EBS snapshot was created.
An AMI image is a backup of an entire EC2 instance. Associated with an AMI image is EBS
snapshots. Those EBS snapshots are the backups of the individual EBS volumes attached to the EC2
instance at the time the AMI image was created.
Manage and control the flow of inbound request to group of targets by distributing the
requests evenly across the targets. The targets may be EC2 instances lambda or containers.
Types of Load balancer:
We can create target groups in order to route to traffic to the respective paths
Spin up an EC2 instance1 in another availability zone (az1) with http port open in Security
group
Add the below script and launch the instance.
#!/bin/bash
yum update -y
yum install httpd -y
systemctl enable httpd
mkdir /var/www/html/mobiles
echo '<h1> Mobiles </h1>' > /var/www/html/mobiles/index.html
systemctl start httpd
Spin up one more EC2 instance1 in another availability zone (az2) with http port open in
Security group
Add the below script and launch the instance.
#!/bin/bash
yum update -y
yum install httpd -y
systemctl enable httpd
mkdir /var/www/html/electronics
echo '<h1> cart </h1>' > /var/www/html/electronics/index.html
systemctl start httpd
Autoscaling
AWS Auto Scaling monitors your applications and automatically adjusts capacity to maintain
steady, predictable performance at the lowest possible cost.
(7)
Route53:
Amazon Route 53 is a highly available, reliable and scalable Domain Name System (DNS)
web service, where we can point IP address to domain name or point host name to another host name.
Use to route traffic to healthy resources, to another resource if the previous one is unhealthy.
Let’s you to route traffic to different AWS locations. We can select country in the dropdown.
Geo-location – Routes resources based on the location of the user, like displaying website in native
language.
Geo-proximity routing – Routes the traffic based on location of the users and their resources
Multi-value answer routing: It returns multiple values in response to DNS queries.
(8)
Simple storage service (S3)
Amazon S3 has a simple web services interface that you can use to store and retrieve any amount of
data, at any time, from anywhere on the web.
Uses HTTP
Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading
scalability, data availability, security, and performance. No matter what kind of file is stored it will be
treated as an abstraction, meaning an object.
It has simple management capabilities that allow you to organize your data and fine tune access
control to match your specific needs.
Buckets are the containers where the objects are stored and then uploaded to S3. There will never be
an object without a bucket.
Limitation of S3 bucket:
Only 100 buckets can be created per account.
Can hold unlimited objects
Bucket Policy: Allow or deny access to buckets or specific objects within the bucket to specific users
or other services within the AWS. Attach the policy written in JSON format and attach it to the
bucket.
S3 Versioning: It is utilized to preserve, recover and restore early versions of every object stored in
the S3 bucket. Not enabled by default.
Cross region replication: Automatic providing of every object uploaded to your buckets, even in
different accounts and region. Appropriate permissions must be given before enabling this.
Transfer Acceleration: It allows easy and fast (reduced latency) transfer of files over long distances
between your client and S3 bucket. It takes advantage of the edge locations around the world. It works
via carrying the data over an optimized network bridge that runs between your client’s edge location
and your S3 bucket.
S3 Storage classes:
There are six storage classes – Hot to Cold
Standard, Standard-IA, Intelligent-Tiering, One Zone-IA, Glacier, Glacier deep archive
Standard(default):
Designed for general- and all-purpose storage
Default storage option
99.999999999% object durability (11 9’s durability)
99.99% object availability
Most expensive storage class.
Reduced Redundancy storage
Designed for non-critical objects
99.99% object durability
99.99% object availability
Less expensive than standard
Infrequent access
Designed for less frequently accessed objects.
99.999999999% object durability
99.99% object availability
Less expensive than reduced redundancy storage
Glacier
Designed for long term archival storage
May take several hours to retrieve the objects from this storage
Cheapest s3 storage class
Can only be accessed from CLI or SDK
One Zone-IA: Standard classes are stored across three availability zones. Only store it in a single
availability zone. If the AZ is destroyed, your data will be gone. Not as durable as standard and
cheaper than them.
Encryption:
Two ways of protecting information with S3
(9)
Lambda
AWS Lambda serverless compute service which lets you run code without provisioning or
managing servers. You pay only for the compute time you consume.
Just upload your code and Lambda takes care of everything required to run and scale your
code with high availability
Manage your virtual functions not really caring about the servers
Run on demand
Scaling is automated
Billing:
Pay per request first one million requests is free
$0.20 per one million request.
compute time 0.00001667 for every GB-seconds used.
Kinesis, API Gateway, DynamoDB, AWS S3, CloudWatch Events, CloudWatch logs, SNS
and Incognito
(10)
Key Management Service (KMS)
AWS Key Management Service (AWS KMS) is a managed service that makes it easy for you to create
and control customer master keys (CMKs), the encryption keys used to encrypt your data.
(11)
AWS secrets
AWS Secrets Manager helps you protect secrets needed to access your applications, services,
and IT resources. The service enables you to easily rotate, manage, and retrieve database credentials,
API keys, and other secrets throughout their lifecycle.
(12)
Relational Database Service (RDS)
Amazon Relational Database Service (Amazon RDS) makes it easy to set up, operate, and
scale a relational database in the cloud.
Encryption in RDS:
Encryption at rest is supported for
Amazon Aurora
PostgreSQL
MySQL
MariaDB
Oracle
Microsoft SQL Server
Q: Which is the non-relational database supported in AWS Amazon DynamoDB is the NoSQL
database supported by AWS