Notes
Notes
1. Region: is a physical location in the world that consists of two or more Availability Zones
(AZs).
2. An Availability Zone: Is one or more discrete data centers – each with redundant power
networking, and connectivity – housed in separate facilities.
3. An Edge Location: are endpoints for AWS that are used for caching content. Typically, this
consists of CloudFront and Amazon’s CDN.
1. Storage
a. S3
b. EBS
c. EFS
d. FSx
e. Storage Gateway
2. Databases
a. RDS
b. DynamoDB
c. Redshift
3. Networking
a. VPCs
b. Direct Connect
c. Route 53
d. API Gateway
e. AWS Global Accelerator
AWS Whitepapers
Read through
1. Operational Excellence: Running and monitoring systems to deliver business value, and
continually improving processes and procedures
2. Performance Efficiency: Using IT and computing resources efficiently
3. Security: Protecting information and systems
4. Cost Optimization: Avoiding unnecessary costs
5. Reliability: Ensuring a workload performs its intended functions correctly and consistently
when it’s expected to.
6. Sustainability: Minimizing the environmental impacts of running cloud workloads.
The root account is the email address you used to sign up for AWS. The root account has full
administrative access.
Exam Tips
Exam Tips
1. Users: A physical person. One user equal to one person. Never share user accounts across
different people
2. Groups: Functions, such as admins, developers etc. Contains users.
3. Roles: Internal usage within AWS.
Only assign a user the minimum number of privileges they need to do their job.
Exam Tips
S3
S3 Overview
S3 Basics
1. Unlimited storage:
2. Objects up to 5TB in Size: O bytes to 5 tb
3. S3 Buckets: Folders inside S3
1. Universal Namespace: All AWS accounts share the S3 namespace. Each S3 Bucket name is
globally unique
2. Example S3 URLs: https://bucket-name.s3.Region.amazonaws/key-name
3. Uploading files: When you upload a file to S3 you receive a HTTP 200 code regarding
successful upload
S3 file features
S3 buckets are spread across the globe to cover high availability and high durability.
S3 Standard
Tiered Storage
Lifecycle Management
Defines rules to automatically transition objects to a cheaper storage tier or delete objects that are
no longer required after a set period of time
Versioning
With versioning, all versions of an object are stored and can be retrieved including deleted objects.
1. Server-side Encryption
a. U can set default encryption on a bucket to encrypt all new objects when are stored
2. Access Control Lists
a. Define which AWS accounts or groups are granted access and the type of access. U
can attach S3 ACLs to individual objects within a bucket
3. Bucket Policies
a. S3 bucket policies specify what actions are allowed or deleted. JSON policies
- After a successful write of a new object (PUT) or an overwrite of an existing object, any
subsequent read request immediately receives the latest version of the object
- Strong consistency for list operations, so after a write, you can immediately perform a list
operation and your file will be there.
What is Versioning?
You can enable versioning in S3 so you can have multiple versions of an object within S3.
Advantages of Versioning
1. All Versions: All versions of an object are stored in S3. This includes all writes and even if
you delete an object.
2. Backup: Can be a great backup tool
3. Cannot be Disabled: Once enabled, versioning cannot be disabled – only suspended.
4. Lifecycle Rules: Can be integrated with lifecycle rules.
5. Support MFA
S3 Storage Classes
1. S3 Standard
a. High Availability and Durability: Data is stored redundantly across multiple devices
in multiple facilities (>= 3 AZs):
i. 99.99% in availability
ii. 99.9999999% durability (11 9’s)
b. Designed for Frequent Access: Perfect for frequently accessed data.
c. Suitable for Most Workloads
i. The default storage class.
ii. Use cases include websites, content distribution, mobile and gaming
applications, and big data analytics.
2. S3 Standard-Infrequent Access (S3 Standard-IA)
a. Rapid Access: Used for data that is accessed less frequently but requires rapid
access when needed.
b. You pay to access the data. There is a low per-GB storage price and per-GB retrieval
fee
c. Use Cases: Great for long-term storage, backups, and as a data store for disaster
recovery files.
3. S3 One Zone-Infrequent Access
a. Like S3 Standard-IA, but data is stored redundantly within a single AZ.
b. Costs 20% less than regular S3 Standard-IA
c. Great for long-lived, infrequently accessed, non-critical data.
4. S3 Intelligent Tiering
a. Frequent and Infrequent Access: Automatically moves your data to the most cost-
effective tier based on how frequently you access each object.
b. Optimize Costs: 0.0025 per 1,000 objects
Glacier Options
- Lifecycle Management automates moving your objects between different storage tiers,
thereby maximizing cost effectiveness.
- S3 Standard: Keep for 30 Days
- S3 IA: After 30 days
- Glacier: After 90 days
Combining Lifecycle Management with Versioning: You can use lifecycle management to move
different versions of objects to different storage tiers.
Exam Tips:
1. S3 Object Lock: You can use S3 Object Lock to store objects using a write once, read many
(WORM) models. It can help prevent objects from being deleted or modified for a fixed
amount of time or indefinitely. You can use S3 Object Lock to meet regulatory requirements
that require WORM storage or add an extra layer of protection against changes and
deletion. S3 Object Modes:
a. Governance Mode: Users can’t overwrite or delete an object version or alter its
lock settings unless they have special permissions. With governance mode, you
protect objects against being deleted by most users, but you can still grant some
users permission to alter the retention settings or delete the object if necessary
b. Compliance Mode: a protected object version can’t be overwritten or deleted by
any user, including the root user in your AWS account. When an object is locked in
compliance mode, its retention mode can’t be changed, and its retention period
can’t be shortened. Compliance mode ensures an object version can’t be
overwritten or deleted for the duration of the retention period.
2. Retention Period: Protects an object version for a fixed amount of time. When you place a
retention period on an object version S3 stores a timestamp in the object version’s metadata
to indicate when the retention period expires. After the retention period expires, the object
version can be overwritten or deleted unless you also placed a legal hold on the object.
3. Legal Hold: S3 Object Lock also enable you to place a legal hold on an object version. Like a
retention period, a legal hold prevents an object version from being overwritten or deleted.
However, a legal hold doesn’t have an associated retention period and remains in effect until
removed. Legal holds can be freely placed and removed by a user who has the s3:
PutObjectLegalHold permission.
Glacier Vault Lock: allows you to easily deploy and enforce compliance controls for individual
S3 Glacier vaults with a vault lock policy. You can specify controls, such as WORM, in a vault
lock policy and lock the policy from future edits. Once locked, the policy can no longer be
changed.
Encrypting S3 Objects
Types of Encryptions
1. Console: Select the encryption setting on your S3 bucket. The easiest way is just a checkbox
in the console.
2. Bucket Policy: You can enforce encryption using a bucket policy. This method sometimes
comes up in the exam. You can create a bucket policy that denies any S3 PUT request that
doesn’t include x-amz-server-side-encryption parameter in the request header.
Optimizing S3 Performance.
S3 Prefixes
S3 Performance
- S3 has extremely low latency. You can get the first byte out of S3 within 100-200
milliseconds.
- You can also achieve a high number of requests: 3.500 PUT/COPY/POST/DELETE and 5,500
GET/HEAD requests per second, per prefix
- You can get better performance by spreading your reads across different prefixes. For
example, if you’re using 2 prefixes you will achieve 11,000 requests per second
- If we used all 4 prefixes in the last example, then we’d get 22,000 requests per second
- If you are using SSE-KMS to encrypt your objects in S3, you must keep in the KMS Limits
- When you upload a file, you will call a GenerateDataKey in KMS API
- When you download a file, you will call a Decrypt in the KMS API
S3 Replication:
Chapter 3 EC2
EC2 = Elastic Compute Cloud: Secure, resizable compute capacity in the cloud.
- Like a VM, only hosted in AWS instead of your own data center
- Designed to make web-scale cloud computing easier for developers
- The capacity you want when you need it
- You are in complete control of your own instances
Pricing Options
1. On Demand: Pay by the hour or the second, depending on the type of instances you run.
a. Flexible: Low cost and flexibility of Amazon EC2 without any upfront payment or
long-term commitment
b. Short-Term: Applications with short-term, spiky, or unpredictable workloads that
cannot be interrupted
c. Testing the Water: Applications being developed or tested on Amazon EC2 for the
first time
2. Reserved: Reserved Capacity for 1 to 3 years. Up to 72% discount on the hourly charge
a. Predictable Usage: Application with steady state or predictable usage
b. Specific Capacity Requirements: Applications that require reserved capacity
c. Pay up Front: You can make upfront payments to reduce the total computing costs
even further
d. Standard RIS: up to 72% off the on-demand prices by paying 3 years upfront
e. Convertible RIS: up to 54% off the on-demand price. Has the option to change to a
different RI type of equal or greater value
f. Scheduled RIS: Launch within the time window you define. Match your capacity
reservation to a predictable recurring schedule that only requires a fraction of a day,
week, or month.
g. Reserved instances operate at a regional level.
h. Savings Plans with Reserved Instances
i. Save up to 72%: All AWS compute usage regardless of instance type or
Region
ii. Commit to 1 to 3 years: Commit to use a specific amount of compute power
(measured by the hour) for a 1-year or 3-year period
iii. Super Flexible: Not only EC2, but this also includes serverless technologies
like LAMBDA and FARGATE
3. Spot: Purchase unused capacity at a discount of up to 90%. Prices fluctuate with supply and
demand.
a. Applications that have flexible start and end times. DON’T USE IT FOR WEBSITE.
b. Applications that are only feasible at a very low compute price
c. Users with an urgent need for large amounts of additional computing capacity
d. Examples of usage:
i. Image Rendering
ii. Genomic sequencing
iii. Algorithmic trading engines
4. Dedicated: A physical EC2 server dedicated for your use. The most expensive option. Great if
you have server-bound licenses to reuse or compliance requirements.
a. Compliance: Regulatory requirements that may not support multi-tenant
virtualization.
b. Licensing: Great for licensing that does not support multi-tenancy or cloud
deployments
c. On-Demand: Can be purchased on Demand
d. Reserved: Can be purchased as a reservation for up to 70% off.
Exam Tips:
- What is EC2?
- What are the pricing options?
The AWS command line allows you to interact with AWS simply by typing commands.
IAM – Create New User and New Group and give it access to the S3
Least Privilege – Always give your users the minimum amount of access required to do their job
Use Groups – Create IAM groups and assign your users to groups. Group permissions are assigned
using IAM policy documents. Your users automatically
AWS CLI Exam Tips
1. Secret Access Key – You will only see this once! If you lose it, you can delete the access key
ID and secret access key and regenerate them. You will need to run AWS configure again.
2. Don’t Share Key Pairs – Each developer should have their access key ID and secret access
key. Just like passwords, they should not be shared.
3. Supports Linux, Windows, Mac OS
Using Roles
- A role is an identity you can create in IAM that has specific permissions. A role is similar to a
user, as it is an AWS identity with permission policies that determine what the identity can
and cannot do in AWS.
- However, instead of being uniquely associated with one person, a role is intended to be
assumed by anyone who needs access to it
- A role does not have standard long-term credentials the same way passwords or access keys
do. Instead, when you assume a role, it provides you with temporary security credentials for
your role session.
Console Demo
Exam Tips
1. Preferred Options: Roles are the preferred option from a security perspective
2. Avoid Hard Coding your credentials: Roles allow you to provide access without the use of
access key IDS and secret access keys.
3. Policies: Policies control a role’s permissions.
4. Updates: you can update a policy attached to a role and it will take immediate effect.
5. Attaching and Detaching: you can attach and detach roles to running EC2 instances without
having to stop or terminate those instances.
Security Groups
- Are virtual firewalls for your EC2 instance? By default, everything is blocked.
- To let everything in 0.0.0.0/0
- To be able to communicate to your EC2 instances via SSH/RDP/HTTP, you will need to open
up the correct ports
Bootstrap Scripts
Exam Tips
- Is simply data about your EC2 instance. This can include information such as Private IP
address, public IP address, hostname, security groups
Retrieving Metadata
- Using the curl command, we can query meta data about our EC2 instance.
Exam Tips
You can attach 3 different types of virtual networking cards to your EC2 instances.
Exam Tips:
1. ENI: for basic networking. Perhaps you need a separate management network from your
production network or a separate logging network, and you need to do this at a low cost. In
this scenario, use multiple ENIs for each network.
2. Enhanced Networking: For when you need speeds between 10 Gbps and 100 Gbps.
Anywhere you need reliable, high throughput
3. EFA: for when you need to accelerate high performance computing (HPC) and machine
learning applications or if you need to do an OS-bypass. If you see a scenario question
mentioning HPC or ML and asking what network adapter you want, choose EFA.
Optimizing with EC2 Placement
1. Cluster: Grouping of instances within a single AZ . Recommended for applications that need
low network latency, high network throughput, or both. Fact: Only certain instance types
can be launched into a cluster placement group.
2. Spread: A spread placement group is a group of instances that are each placed on the
distinct underlying hardware. Spread placement groups are recommended for applications
that have a small number of critical instances that should be kept separate from each other.
Used for individual instances.
3. Partition: Each partition placement group has its own set of racks. Each rack has its own
network and power source. No two partitions within a placement group share the same
racks, allowing you to isolate the impact of a hardware failure within your application.
Multiple EC2 instances: HDFS
Exam Tips:
1. A cluster placement group can’t span multiple AZs, whereas a spread placement group and
partition placement group can.
2. Only certain types of instances can be launched in a placement group (compute optimized,
GPU, memory optimized, storage optimized)
3. AWS recommends homogenous instances within a cluster placement groups
4. You can’t merge placement groups
5. You can move an existing instance into a placement group. Before you move the instance,
the instance must be in the stopped state. You can move or remove an instance using the
AWS CLI or an AWS SDK, but you can’t do it via the console yet.
- AWS EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS Cloud.
Spot Instances are available at up to 90% discount compared to On-Demand Prices
- WHEN TO USE SPOT INSTANCES?
o Stateless, fault-tolerant, or flexible applications
Applications such as big data, containerized workloads, CI/CD high-
performance computing (HPC), and other test and development workloads
Spot Prices
- To use spot instances, you must first decide on your maximum spot prices, the instance will
be provisioned so long as the spot price is below your maximum spot price
- The hourly spot price varies depending on capacity and region
- If the spot price goes above your maximum, you have 2 mins to choose whether to stop or
terminate your instance
Spot Blocks
- You may also use a spot block to stop your spot instances from being terminated even if the
spot price goes over your max spot price. You can set spot blocks for between 1 to 6 hours
currently.
-
Use Cases
1. Persistent Workloads
2. Critical Jobs
3. Databases
Terminating Spot Instances
Launch Pools
1. Setup different launch pools. Define things like EC2 instance type, operating system, and AZ.
2. You can have multiple pools, and the fleet will choose the best way to implement depending
on the strategy you define.
3. Spot fleets will stop launching instances once you reach your price threshold or your
capacity desire.
Strategies
- capacityOptimized: the spot instances come from the pool optimal capacity for the number
if instances launching
- lowestPrice: the spot instances come from the pool with the lowest price. this is the default
strategy
- diversified: the spot instances are distributed across all pools.
- InstancePoolstoUseCount: the spot instances are distributed across the number of spot
instances pools you specify. This parameter is valid only when used in combination with
lowestPrice.
Exam Tips
- VMware is used by organizations around the world for private cloud deployments. Some
organizations opt for a hybrid cloud strategy and would like to leverage AWS services.
Use Cases
1. Hybrid Cloud: Connect your on-premises cloud to the AWS public cloud, and manage a
hybrid workload
2. Cloud Migration: Migrate your existing cloud environment to AWS using VMware’s built-in
tools
3. Disaster Recovery: VMware is famous for its disaster recovery technology. Using hybrid
cloud, you can have an inexpensive disaster recovery environment on AWS.
4. Leverage AWS: Use over 200 services to update your applications or to create new ones
Deployment
Exam Tips
- Outposts brings the AWS data center directly to you, on-premises. Outposts allows you to
have the large variety of AWS services in your data center. You can have Outposts in sizes
such as 1U and 2U servers all the way up to 42U racks and multiple-rack deployments.
Benefits
1. Hybrid Cloud
2. Fully Managed Infrastructure
3. Consistency
Family Members
- EC2 is like a VM, hosted in AWS instead of your own data center
- Select the capacity you need right now, grow and shrink when you need, Pay for what you
use
- EC2 Instance Pricing Option
o On-Demand
o Spot
o Reserved
o Dedicated
- AWS Command Line Interface
o Least Privilege
o Use Groups
- Roles are the Preferred Option
- Avoid Hard Coding Your Credentials
- Policies control a role’s permission
-
Elastic Block Storage (EBS) and Elastic File System (EFS)
Mission Critical
EBS Volume Types; Solid State Disk (SSD) (Used for installing applications on)
- Consistent Snapshots: Snapshots only capture data that has been written to your AWS EBS
Volume, which might exclude any data that has been locally cached by your application or
OS. For a consistent snapshot, it is recommended you stop the instance and take a snap
- Encrypted Snapshots: If you take a snapshot of an encrypted EBS volume, the snapshot will
be encrypted automatically
- Sharing Snapshots: You can share snapshots, but only in the region in which they were
created. To share to other regions, you will need to copy them to the destination region first
Console Demo
Exam Tips
EBS Encryption
- EBS encrypts your volume with a data key using the industry standard AES 256 algo. Amazon
EBS encryption uses AWS Key Management Service (AWS KMS) customer master keys (CMK)
when creating encrypted volumes and snapshots.
- SQL server
- Oracle
- My Sql
- PostgreSQL
- MariaDB
- Aurora
RDS Advantages
- Understand the difference between online transaction processing and only analytical
processing (OLAP)
- OLTAP:
o processes data from transactions in real time.
o OLTP is all about data processing and completing large numbers of small
transactions in real time
- OLAP:
o Processes complex queries to analyze historical data
o OLAP is all about data analysis as well complex queries that take a long time to
complete.
RDS is not suitable for analyzing large amounts of data. Use data warehouse like Redshift, which is
optimized for OLAP.
- With Multi-AZ, RDS creates an exact copy of your production databases in another AZ.
- AWS handles the replication for you.
o When you write to your production databases, this write will automatically
synchronize to the standby databases.
o SQL server, MYSQL, MARIADB, ORACLE, PostgreSQL can be single AZs.
- RDS will automatically fail over to the standby during a failure so databases operations can
operate normally.
- Multi AZ is only for disaster recovery, not for performance enhancement.
Key Facts
- A MySQL and PostgreSQL compatible relational database engine that combines the speed
and availability of high-end commercial databases with the simplicity and cost-effectiveness
of open-source databases.
- 5x performance:
o Up to 5 times better performance than MySQL and 3 times better than PostgreSQL
databases at a much lower price point, while delivering similar performance and
availability.
- Start with 10 GB. Scales in 10-GB increments to 128TB (storage Auto Scaling)
- Compute resources can scale up to 96 vCPUs and 768 GB of memory.
- 2 copies of your data are contained in each availability zone, with a minimum of 3 avaliabilty
zones. 6 copies of your data.
Scaling Aurora
- Automated backups are always enabled on Aurora DB instances. Backups do not impact
performance
- You can take snapshots with Aurora
- You can share Aurora snapshots with other AWS accounts.
Aurora Serverless
- DB cluster automatically starts up, shuts down, and scales capacity up or down based on
your application needs. Essentially use it when you need it.
- Relatively simple, cost-effective option for infrequent, intermittent or unpredictable
workloads.
Exam Tips
DynamoDB
- A fast and flexible NoSQL database service for all applications that need consistent, single-
digit millisecond latency at any scale.
- It is fully managed databases and supports both document and key-value data models
- Its flexible data models and reliable performance make it a great fit for mobile, web, gaming,
ad-tech, IoT and many other applications.
Key Facts
Eventually: Consistency across all copies of data is usually reached within a second. Repeating a read
after a short time should return the updated data. Best read performance.
Strong: consistent read returns a result that reflects all writes that received a successful response
prior to the read.
On Demand Capacity:
- Pay-per-request pricing
- Balance cost and performance
- No minimum capacity
- Pay more per request than with provisioned capacity
- Use for new product launches.
Security