Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Infrastructure as Code (IaC)
Infrastructure as Code (IaC) means you write your cloud setup in a file.
- AWS CloudFormation uses YAML or JSON templates.
- One template can build dev, staging, and production.
- Templates live in Git and get the same review as code.
- Big systems work better as small stacks, not one giant template.
In more detail
- A template has parts. Parameters give values. Resources are the real AWS parts. Outputs return useful values.
- CloudFormation reads the template and builds resources in the right order. If a step fails, it can roll back.
- A change set shows what an update will change before you apply it.
- One stack can export a value. Another stack imports it. This keeps stacks loosely coupled.
- CloudFormation is deep in AWS. Terraform works with many clouds and keeps its own state file. Use Terraform for multi-cloud or non-AWS work.
Continuous Integration and Continuous Delivery (CI/CD)
CI tests every code change right away.
- CD moves a good build to servers with no hand work.
- AWS CodePipeline runs the pipeline stages.
- CodeBuild builds and tests. CodeDeploy puts the app on servers.
- Tests and rollback keep deploys safe.
In more detail
- CI starts when code reaches the repo. It builds, tests, and scans. Bad code stops early.
- A pipeline has stages: source, build, test, deploy. Each stage does one job.
- A buildspec is a YAML file for CodeBuild. It lists install, pre-build, and build steps.
- CodeDeploy can do blue-green, rolling, canary, or all-at-once deploys.
- Tests form a pyramid: many unit tests, fewer integration tests, a few end-to-end tests.
- Rollback can be automatic from bad health checks or high error rates. Database changes are hard to undo, so use additive changes.
Change Management Processes
Change management controls when and how changes happen.
- AWS Systems Manager Change Calendar shows open and closed windows.
- Pipelines can check the calendar before a deploy.
- A manual approval adds a human check.
- Audit trails show who changed what and when.
In more detail
- Change Calendar is a shared schedule. It stops two changes from overlapping.
- A pipeline can ask the calendar. If the window is closed, the deploy waits.
- Approval can be early, before a build. Late approval is better, because test results are ready.
- Rules like SOX, HIPAA, PCI-DSS, and ISO 27001 need proof. Segregation of duties means the writer does not approve.
- Emergency changes need a fast path. The fast path still leaves a record.
Configuration Management Tools
Configuration management keeps all servers the same.
- AWS Systems Manager runs commands and patches at scale.
- Patch Manager applies the patches you allow.
- State Manager keeps the wanted state.
- Parameter Store keeps settings in one place.
In more detail
- The SSM Agent runs on each instance. It talks to Systems Manager over an encrypted link. You do not need SSH keys or a bastion host.
- A patch baseline says which patches are allowed. A maintenance window says when to apply them.
- Run Command runs one command on many instances. Session Manager gives a shell through the agent.
- State Manager applies an association, so the wanted state stays true.
- Parameter Store holds settings in a tree, such as /app/dev/db-url. Apps read values at runtime.
- Drift is when a server differs from the wanted state. Systems Manager finds it, fixes it, and reports compliance.
Encryption Options
Encrypt data at rest and in transit. AWS KMS creates and protects keys.
- S3, RDS, and EBS each have encryption options.
- TLS protects traffic between services.
- ACM issues and renews certificates.
In more detail
- KMS keys live in hardware security modules (HSMs). Your apps never see the raw key.
- A CMK is the top key. KMS uses it to make data keys. Key policies decide who can use a key.
- S3 has three main choices: SSE-S3 (S3 manages keys), SSE-KMS (KMS manages keys), and client-side encryption (you encrypt before upload).
- EBS encrypts volumes and snapshots. RDS encrypts the database storage.
- TLS 1.2 is strong and works almost everywhere. TLS 1.3 is faster and has forward secrecy.
- ACM gives free public certificates and renews them for you. A private CA is for internal names.
AWS Managed Security Services
AWS Shield protects against DDoS attacks.
- AWS WAF filters web requests with rules.
- GuardDuty finds bad activity in your account.
- Security Hub collects findings in one place.
In more detail
- Shield Standard comes at no extra cost and is on for all AWS services. It stops common network floods.
- Shield Advanced adds better detection, the DDoS Response Team, and cost protection.
- WAF rules can look at IP, country, headers, body, URI, and size. Actions are block, allow, count, or log. It can rate-limit clients and block SQL injection or XSS.
- GuardDuty reads VPC Flow Logs, DNS logs, and CloudTrail. It uses machine learning and ranks findings by severity.
- Security Hub gathers findings from GuardDuty, Config, Inspector, Macie, and Systems Manager. It also takes third-party tools.
Multi-AZ and Multi-Region Architectures
An Availability Zone (AZ) is one or more data centers in a region.
- Multi-AZ keeps a system up when one AZ fails.
- Multi-Region keeps a system up when a whole region fails.
- RTO and RPO measure disaster recovery.
In more detail
- AZs have separate power, cooling, and network. Put servers in at least two AZs, with a load balancer and Auto Scaling group.
- RDS Multi-AZ keeps a standby copy in a second AZ.
- Multi-Region helps with big disasters, global users, and data location rules.
- Route 53 can route by failover, latency, geography, or weight. Health checks remove bad endpoints.
- RTO is the time to get service back. RPO is how much data you can lose.
- Common disaster designs: active-active (both live), warm standby (small copy ready), and cold (build after the failure).
Auto Scaling Policies
Auto Scaling matches capacity to demand.
- Target tracking keeps a metric at a set value.
- Step scaling reacts to how big an alarm is.
- Predictive scaling uses past patterns.
- Lambda and EventBridge can scale on business events.
In more detail
- Target tracking is the simplest. Set a target, like 70% CPU. AWS adds or removes instances to hold it.
- Step scaling uses alarms and thresholds. A small spike adds a few instances. A big spike adds many.
- Predictive scaling learns from history and adds capacity before the rush.
- Scheduled scaling is for planned events with known capacity needs.
- A cooldown stops fast up-and-down changes. Warm-up gives new instances time to start before they count.
- Event-driven scaling skips metrics. EventBridge sees a business event and calls Lambda, and Lambda changes capacity.
Application Integration
SNS is pub/sub messaging.
- SQS is a queue for reliable messages.
- Step Functions runs multi-step workflows.
- Retries and dead-letter queues handle errors.
In more detail
- A publisher sends to an SNS topic. It does not know who reads the message. Subscribers can be SQS, Lambda, email, or SMS.
- SQS stores messages until a consumer is ready. Standard queues are fast, with at-least-once delivery. FIFO keeps order and delivers once.
- A visibility timeout hides a message while one consumer works. A dead-letter queue keeps messages that fail too many times.
- Step Functions uses a state machine. It can branch, run steps in parallel, retry, and catch errors.
- Retries use exponential backoff and a maximum count. Consumers should be idempotent.
Performance Monitoring
CloudWatch metrics show numbers over time.
- Alarms watch a metric and send a message.
- Logs Insights searches and groups logs.
- Dashboards show the whole system on one page.
In more detail
- AWS services send default metrics, like EC2 CPU and RDS connections.
- Your app can send custom metrics, like orders per minute. Dimensions split a metric by instance or environment.
- An alarm has a threshold, a period, and a number of checks. It can notify SNS or change capacity. Composite alarms combine alarms, so you get fewer false alarms.
- Logs Insights uses a query language. You can filter, parse fields, and count events.
- Trace IDs link log lines from one request across services.
- Dashboards put key metrics and alarms in one view.
Storage Options
S3 has many storage classes.
- Pick a class by how often you read the data.
- Lifecycle rules move data to cheaper classes.
- Colder classes cost less to store and more to read.
In more detail
- S3 Standard is for hot data. It gives low latency, 11 nines of durability, and 99.99% availability.
- S3 Intelligent-Tiering moves objects when access changes. You do not move them by hand.
- S3 Standard-IA is cheaper to store and charges for reads. It has a 30-day minimum. One Zone-IA keeps data in one AZ; use it for copies you can rebuild.
- Glacier Instant Retrieval is for archives you read in milliseconds.
- Glacier Flexible takes minutes to hours. Deep Archive takes 12 to 48 hours.
- A lifecycle rule can transition, expire, or delete versions. It can filter by prefix, tag, or size.
Instance Families
An instance family is a hardware shape for a type of work.
- General purpose (M, T, A) fits many jobs.
- Compute (C), memory (R, X, Z), and storage (I, D) fit special jobs.
- Accelerated (P, G, F, Inf) adds GPUs and other special chips.
- Spot Instances are cheap but can stop.
In more detail
- M is balanced. T is burstable: it earns CPU credits when idle and spends them on a burst. A is another general-purpose option.
- C gives more CPU per dollar. R, X, and Z give more memory.
- I and D have fast local disks. P and G have GPUs. F has FPGAs. Inf is tuned for AI inference.
- Match the workload first, then test. A wrong family wastes money or slows the app.
- Spot uses spare EC2 capacity. The discount is often 50-90%. AWS gives a two-minute warning before it stops an instance.
- Use Spot for batch, CI, and stateless work. Save checkpoints so a stop is not a loss.
Purpose-Built Databases
Pick a database by data shape and access pattern.
- Relational databases use tables and ACID transactions.
- DynamoDB is key-value at massive scale.
- Special services fit graphs, caches, analytics, and time series.
In more detail
- RDS and Aurora are relational. They are good for joins, reports, and strong consistency.
- DynamoDB gives single-digit millisecond reads at any scale. It is serverless and has global tables.
- Redshift is a data warehouse for analytics on large data.
- ElastiCache keeps data in memory. Neptune is for graphs, DocumentDB for JSON, and Timestream for time series.
- ACID means Atomicity, Consistency, Isolation, and Durability. NoSQL gives up some of this for scale.
- Choose by access pattern, not by habit. A key-value lookup does not need a relational database.
AWS Cost and Usage Monitoring
Cost Explorer shows where the money goes.
- Trusted Advisor gives cost and usage checks.
- Budgets sends alerts before you overspend.
- Pricing models trade a commitment for a lower price.
- Spot is the cheapest, but AWS can take it back.
In more detail
- Cost Explorer filters by service, region, tag, or instance type. It shows 12 months of history and a forecast.
- Trusted Advisor looks for idle resources, low use, and unused reservations.
- AWS Budgets can track cost, usage, or reserved use. It sends an alert at a set percent.
- On-Demand has no promise and the highest price. It fits spiky or short work.
- Reserved Instances and Savings Plans cut the price for a 1- or 3-year promise. Compute Savings Plans cover EC2, Lambda, and Fargate.
- Spot can save up to 90%. Use it for work that can stop.
Storage Costing
Storage cost has three parts: storage, retrieval, and transfer.
- Lifecycle rules move cold data to cheaper classes.
- Retrieval fees can make a cheap class cost more.
- Direct Connect and CloudFront cut transfer costs.
- Cross-region transfer is expensive.
In more detail
- Move data from Standard to Standard-IA, then to Glacier, based on age.
- Standard-IA has a 30-day minimum and a per-GB retrieval fee.
- Glacier speed: expedited 1-5 minutes, standard 3-5 hours, bulk 5-12 hours. Deep Archive takes 12 or 48 hours.
- AWS Direct Connect is a private link from your data center. It is cheaper for large volumes and pays off near 1 TB per month.
- CloudFront caches content at edge sites. Fewer requests reach the origin, so transfer costs fall.
- Cross-region transfer costs about $0.02 to $0.12 per GB, in both directions. Keep data close to users and jobs.
AWS Managed Services
Managed services let AWS run the servers.
- RDS runs databases. ECS and Fargate run containers. Lambda runs functions.
- You trade control for less operational work.
- The unit price is higher, but total cost can be lower.
- Choose managed for standard needs and small teams.
In more detail
- RDS handles patching, backups, and Multi-AZ. You pick the engine and size.
- ECS runs containers on your instances. Fargate runs them with no servers to manage.
- Lambda runs code when an event happens. It scales from zero, and you pay for each run, not idle time.
- A managed resource often costs 20-50% more than a self-managed one.
- Self-managed has hidden costs: monitoring, backups, security tools, and staff time. TCO adds people time and risk, not just the bill.
- Use self-managed only when you need deep control or a special setup.
Key terms
The words of this course in one table. Learn them before the quiz or exam.
| Term | Meaning |
|---|---|
| ACID | The four guarantees of a safe transaction. |
| ACM | The AWS service for certificates. |
| Alarm | A rule that watches a metric and acts. |
| Approval stage | A pipeline step that waits for a person. |
| Artifact | The versioned build output that gets deployed. |
| Audit trail | The record of changes and approvals. |
| Auto Scaling | A service that adds or removes servers to match demand. |
| Availability Zone | An isolated group of data centers in a region. |
| Blue/green deployment | A deploy that switches traffic from the old version to the new one. |
| Blue-green | Two environments, with traffic switched between them. |
| Budget | A spending limit with alerts. |
| Buildspec | The YAML file that tells CodeBuild what to do. |
| Burstable | An instance that saves CPU credits and bursts later. |
| Change Calendar | A shared schedule that shows when changes are allowed. |
| Change set | A preview of a stack update. |
| Change window | A time when changes are allowed. |
| CloudFormation template | A YAML or JSON file that describes AWS resources. |
| Configuration drift | When real servers slowly differ from the wanted setup. |
| Cooldown | A wait time before the next scaling action. |
| Cost Explorer | The tool for cost charts and filters. |
| Data warehouse | A store built for large analytics queries. |
| DDoS | A flood of traffic that tries to take a service down. |
| DDoS attack | A flood of fake traffic that tries to take a site down. |
| Dead-letter queue | The queue for messages that keep failing. |
| Direct Connect | A private network link to AWS. |
| Drift | A real server differs from the wanted setup. |
| Durability | The chance your data is not lost. |
| Edge cache | A copy of content stored near users. |
| Encryption at rest | Data is encrypted on disk. |
| Encryption in transit | Data is encrypted on the network. |
| Encryption key | A secret value used to lock and unlock data. |
| Failover | Moving traffic to a healthy copy. |
| Fargate | Serverless compute for containers. |
| Finding | One security issue or alert. |
| GuardDuty | A service that watches for bad activity in an AWS account. |
| Infrastructure as Code | Writing your cloud setup in files instead of clicking. |
| Instance family | A group of instance types with the same hardware shape. |
| KMS key | The protected key that locks and unlocks data. |
| Lifecycle policy | The rule that moves or deletes data. |
| Lifecycle transition | A rule that moves data to another class. |
| Log group | A container for related log streams. |
| Maintenance window | The time set for updates. |
| Managed service | AWS runs the servers and routine work. |
| Metric | A number that changes over time. |
| Multi-AZ | Running a system in two or more Availability Zones. |
| NoSQL | A database with a non-table data model. |
| Parameter | A value you pass in at deploy time. |
| Parameter Store | A central place for settings and secrets. |
| Partition key | The field DynamoDB uses to spread data. |
| Patch baseline | The list of patches that are allowed. |
| Pipeline | The automated path from commit to deploy. |
| Pub/Sub | A pattern where a sender posts a message and many readers get it. |
| Queue | The SQS buffer that holds messages. |
| Region | A large geographic area with several AZs. |
| Relational database | Data in tables, with SQL and joins. |
| Reserved Instance | A 1- or 3-year promise for a lower price. |
| Retrieval fee | The cost to read data back. |
| RPO | The maximum data loss you accept. |
| RTO | The target time to restore service. |
| Savings Plan | A flexible spend promise for a lower price. |
| Security Hub | The single view for security findings. |
| Segregation of duties | No one person controls a change from start to end. |
| Serverless | You run code without managing servers. |
| Spot Fleet | A group of Spot and On-Demand instances managed together. |
| Spot Instance | Spare capacity at a low price that can be taken back. |
| Stack | The resources built from one template. |
| State machine | The Step Functions workflow. |
| Step scaling | Add capacity in steps, based on alarm size. |
| Storage class | A price and performance level for objects. |
| Target tracking | Keep one metric at a chosen value. |
| TCO | The full cost of owning a system over time. |
| Template | The file that describes your infrastructure. |
| TLS | The protocol that secures network traffic. |
| Topic | The SNS channel that publishers send to. |
| Total cost of ownership | All costs of a system, not just the server price. |
| Trace ID | The ID that follows one request across services. |
| Visibility timeout | The time a message is hidden while being processed. |
| WAF | A firewall that filters web requests. |
| WAF rule | A check that allows, blocks, or counts a request. |
| Warm-up | Time for a new instance to be ready. |
Check yourself
Answer each question first, then open it to check the answer.
1What is a CloudFormation template?
A YAML or JSON file that describes the AWS resources you want.
2Why do we use parameters?
To reuse one template for different environments and sizes.
3What does CI do when a developer commits code?
It builds, tests, and scans the change, and stops on failure.
4Why is blue-green deployment safe?
The old version stays ready, so traffic can move back fast.
5What does Change Calendar do?
It shows when changes are allowed and stops overlaps.
6Why is segregation of duties important?
It stops one person from making and approving the same change.
7Why is the SSM Agent useful?
It lets you manage instances without SSH keys or a bastion host.
8What is configuration drift?
When a server no longer matches the wanted setup.
9What is the difference between data at rest and data in transit?
At rest means stored on disk. In transit means moving on the network.
10Why is TLS 1.3 better than TLS 1.2?
It is faster and has forward secrecy by default.
11What is the difference between Shield Standard and Shield Advanced?
Standard is free and automatic. Advanced adds expert help and cost protection.
12What data does GuardDuty read?
VPC Flow Logs, DNS logs, and CloudTrail events.
13When do you need Multi-Region instead of Multi-AZ?
When a whole region can fail, or users are spread across the world.
14What do RTO and RPO mean?
RTO is the time to recover. RPO is the data you can lose.
15When is target tracking a good choice?
For steady work where load and CPU move together.
16What does event-driven scaling add?
It scales on business events, not only on metrics.
17Why does SNS reduce coupling?
The publisher sends one event and does not need to know the readers.
18What is a dead-letter queue for?
It holds messages that fail, so you can inspect them.
19What can an alarm do when it fires?
Send a notice, change capacity, or run an action.
20Why are trace IDs useful?
They connect log lines from the same request across services.
21When do you use S3 Standard-IA?
For data read less often that still needs fast access.
22What does a lifecycle rule do?
It moves or deletes objects after a set time or condition.
23Which family fits a memory-heavy database?
The R or X memory-optimized family.
24When is Spot a good fit?
For work that can stop or restart, like batch jobs and CI.
25When is DynamoDB a better choice than RDS?
For huge scale and simple key lookups with low latency.
26What does ACID protect?
It keeps transactions complete, correct, isolated, and saved.
27What does Trusted Advisor look for?
Waste, low use, unused reservations, and risk checks.
28Why are Savings Plans more flexible than Reserved Instances?
They can cover EC2, Lambda, and Fargate, not just one instance family.
29Why can a cheap storage class cost more in the end?
Retrieval fees and minimum storage time can add up.
30How does CloudFront lower transfer cost?
It serves content from the edge, so less data leaves the origin.
31Why can a managed service be cheaper than the bill suggests?
It removes staff time, tools, and other hidden costs.
32When do you keep a self-managed database?
When you need deep control, a custom setup, or a special engine.
Useful links
Official documentation and pages for this course.
- AWS Well-Architected Framework — design pillars and best practice.
- AWS CloudFormation User Guide — templates and stacks.
- AWS CodePipeline User Guide — CI/CD pipelines.
- Amazon S3 storage classes — class choice and lifecycle.
- AWS pricing — price models and calculators.