Cloud for beginnersคลาวด์สำหรับผู้เริ่มต้น
Cloud Fundamentals
The ideas behind every cloud, learned onceแนวคิดเบื้องหลังทุกคลาวด์ เรียนครั้งเดียวใช้ได้ทุกที่
AWS, Azure and Google Cloud have hundreds of services with different names, but they rest on the same handful of ideas: rent computers by the minute, spread them over regions and zones, control who may do what, put them in private networks, store data in a few kinds of storage, and pay for exactly what you use. Learn those ideas here, then the provider guides (AWS, Azure, Google Cloud) show them in practice. AWS, Azure และ Google Cloud มีบริการหลายร้อยตัวที่ใช้ชื่อต่างกัน แต่ทั้งหมดตั้งอยู่บนแนวคิดไม่กี่ข้อเดียวกัน ได้แก่ เช่าคอมพิวเตอร์เป็นนาที กระจายไว้ตาม region และ zone ควบคุมว่าใครทำอะไรได้ วางไว้ในเครือข่ายส่วนตัว เก็บข้อมูลในที่เก็บไม่กี่แบบ และจ่ายตามที่ใช้จริง เรียนแนวคิดเหล่านั้นที่นี่ แล้วคู่มือของแต่ละผู้ให้บริการ (AWS, Azure, Google Cloud) จะแสดงการใช้งานจริง
Shortcut: pressคีย์ลัด: กด Ctrl+Enter (⌘+Enter Mac) inside a code box to run it.ในกล่องโค้ดเพื่อรันทันที
- Coversครอบคลุม AWS · Azure · Google Cloud
- Labs run inแล็บรันใน your browserเบราว์เซอร์ของคุณ
Foundationsพื้นฐาน
Service models, regions and zones, and how reliable things really are.รูปแบบบริการ region และ zone และระบบน่าเชื่อถือแค่ไหนจริงๆ
Lessons 1–4 →บทที่ 1–4 →Building blocksส่วนประกอบ
Who may do what, private networks, compute and storage.ใครทำอะไรได้ เครือข่ายส่วนตัว การประมวลผล และที่เก็บข้อมูล
Lessons 5–8 →บทที่ 5–8 →Money and mapsเงินและแผนที่
What makes the bill, and the same service on three clouds.อะไรทำให้เกิดค่าใช้จ่าย และบริการเดียวกันบนสามคลาวด์
Lessons 9–10 →บทที่ 9–10 →Lesson 1 · Foundationsบทที่ 1 · พื้นฐาน
What the cloud isคลาวด์คืออะไร
"The cloud" is someone else's data centres, rented through an API. Instead of buying servers, waiting weeks and guessing how many you'll need, you ask for computers, storage and databases with a click or a command, get them in minutes, and pay per second or per gigabyte while you use them. Three things make it different from renting a server: it's on demand, it's elastic (grow and shrink any time), and everything is controlled by an API, so it can be automated. "คลาวด์" คือศูนย์ข้อมูลของคนอื่นที่เราเช่าผ่าน API แทนที่จะซื้อเซิร์ฟเวอร์ รอหลายสัปดาห์ และเดาว่าต้องใช้กี่เครื่อง เราขอคอมพิวเตอร์ ที่เก็บข้อมูล และฐานข้อมูลได้ด้วยการคลิกหรือคำสั่งเดียว ได้มาในไม่กี่นาที และจ่ายเป็นวินาทีหรือเป็นกิกะไบต์เท่าที่ใช้ สามสิ่งที่ทำให้ต่างจากการเช่าเซิร์ฟเวอร์คือ ได้ทันทีเมื่อต้องการ (on demand) ยืดหยุ่น (elastic) ขยายและลดได้ทุกเมื่อ และทุกอย่าง ควบคุมผ่าน API จึงทำให้เป็นอัตโนมัติได้
| Modelรูปแบบ | You getสิ่งที่ได้ | You still manageสิ่งที่ยังต้องดูแลเอง | Examplesตัวอย่าง |
|---|---|---|---|
| IaaS | virtual machines, disks, networksvirtual machine ดิสก์ เครือข่าย | the OS and everything on itระบบปฏิบัติการและทุกอย่างบนนั้น | EC2, Azure VMs, Compute Engine |
| PaaS | a place to run your code or a managed databaseที่สำหรับรันโค้ด หรือฐานข้อมูลที่มีคนดูแลให้ | your code, data and settingsโค้ด ข้อมูล และการตั้งค่าของเรา | Cloud Run, App Service, RDS |
| Serverless | run a function per event; pay only while it runsรันฟังก์ชันต่อหนึ่งเหตุการณ์ จ่ายเฉพาะตอนที่ทำงาน | just the functionเฉพาะตัวฟังก์ชัน | Lambda, Azure Functions |
| SaaS | a finished applicationแอปพลิเคชันที่พร้อมใช้ | your users and dataผู้ใช้และข้อมูลของเรา | Gmail, GitHub, Microsoft 365 |
The higher up the table, the more control you have and the more work you do. Moving down hands work to the provider (patching, scaling, backups) but ties you closer to that provider. Most teams mix them: managed databases, containers on a platform, and VMs only where they must.ยิ่งอยู่บนในตาราง เรายิ่งควบคุมได้มากและต้องทำงานเองมาก การขยับลงล่างคือส่งงานให้ผู้ให้บริการ (แพตช์ การขยาย การสำรองข้อมูล) แต่ก็ผูกติดกับผู้ให้บริการรายนั้นมากขึ้น ทีมส่วนใหญ่ใช้ผสมกัน คือฐานข้อมูลแบบ managed, container บนแพลตฟอร์ม และใช้ VM เฉพาะเมื่อจำเป็น
Lesson 2 · Foundationsบทที่ 2 · พื้นฐาน
Regions and availability zonesRegion และ availability zone
A region is a city-sized area with cloud data centres, such as Singapore, Jakarta or Bangkok. Inside a region are usually three or more availability zones: separate data centres with their own power, cooling and network, a few kilometres apart and joined by very fast links. A fire or power cut in one zone shouldn't touch the others. region คือพื้นที่ขนาดประมาณหนึ่งเมืองที่มีศูนย์ข้อมูลของคลาวด์ เช่น สิงคโปร์ จาการ์ตา หรือกรุงเทพฯ ภายใน region มักมี availability zone สามแห่งขึ้นไป คือศูนย์ข้อมูลที่แยกกันและมีไฟฟ้า ระบบทำความเย็น และเครือข่ายของตัวเอง อยู่ห่างกันไม่กี่กิโลเมตรและเชื่อมกันด้วยลิงก์ที่เร็วมาก ไฟไหม้หรือไฟดับใน zone หนึ่งไม่ควรกระทบ zone อื่น
| Choosing a regionการเลือก region | Whyเหตุผล |
|---|---|
| close to your usersใกล้ผู้ใช้ | every request crosses the distance; a few thousand kilometres adds tens of millisecondsทุกคำขอต้องเดินทางตามระยะทาง ไม่กี่พันกิโลเมตรเพิ่มเวลาหลายสิบมิลลิวินาที |
| laws about dataกฎหมายเรื่องข้อมูล | some data must stay in the country (data residency)ข้อมูลบางประเภทต้องอยู่ในประเทศ (data residency) |
| services and priceบริการและราคา | not every service exists in every region, and prices differ by regionไม่ใช่ทุกบริการมีในทุก region และราคาต่างกันไปตาม region |
Design rule: run important things in at least two zones. One zone failing is rare but normal; a whole region failing is very rare, and protecting against it (a second region) costs much more. The next lesson shows why two zones help so much. หลักการออกแบบคือ รันสิ่งที่สำคัญใน อย่างน้อยสอง zone zone หนึ่งล่มนั้นเกิดขึ้นได้แม้จะไม่บ่อย ส่วนทั้ง region ล่มนั้นเกิดขึ้นยากมาก และการป้องกัน (ใช้ region ที่สอง) มีค่าใช้จ่ายสูงกว่ามาก บทถัดไปจะแสดงว่าทำไมสอง zone จึงช่วยได้มาก
Lesson 3 · Foundationsบทที่ 3 · พื้นฐาน
Reliability and SLAsความน่าเชื่อถือและ SLA
Providers promise availability in a service level agreement (SLA), like "99.9% per month", and give credits if they miss it. The "nines" sound alike but mean very different amounts of downtime: ผู้ให้บริการสัญญาเรื่องความพร้อมใช้งานไว้ใน service level agreement (SLA) เช่น "99.9% ต่อเดือน" และคืนเครดิตถ้าทำไม่ได้ จำนวน "เลขเก้า" ฟังดูคล้ายกัน แต่หมายถึงเวลาที่ระบบล่มต่างกันมาก
Your app depends on several services in a chain: a load balancer, a VM, a database. It works only if all of them work, so their availabilities multiply, and the result is lower than any one of them. Running two VMs in different zones changes the picture: the app is down only if both are down at the same time. แอปของเราพึ่งพาหลายบริการต่อกันเป็นสาย เช่น load balancer, VM และฐานข้อมูล แอปทำงานได้ก็ต่อเมื่อทุกตัวทำงาน ความพร้อมใช้งานจึง คูณกัน และผลลัพธ์ต่ำกว่าตัวใดตัวหนึ่ง การรัน VM สองเครื่องในต่าง zone เปลี่ยนภาพนี้ เพราะแอปจะล่มก็ต่อเมื่อทั้งสองเครื่องล่มพร้อมกัน
The second VM cut expected downtime from about 69 to 26 minutes a month, and what's left now comes mostly from the database and the load balancer. That is the whole idea of high availability: find the single points of failure and give each one a partner in another zone. VM เครื่องที่สองลดเวลาที่คาดว่าจะล่มจากประมาณ 69 เหลือ 26 นาทีต่อเดือน และส่วนที่เหลือตอนนี้มาจากฐานข้อมูลและ load balancer เป็นหลัก นี่คือแนวคิดทั้งหมดของ high availability คือหาจุดที่ล้มแล้วระบบล่มทั้งหมด (single point of failure) แล้วให้แต่ละจุดมีคู่ใน zone อื่น
Lesson 5 · Building blocksบทที่ 5 · ส่วนประกอบ
Identity and accessตัวตนและสิทธิ์การเข้าถึง
Every API call to a cloud is made by an identity, a principal: a person, or a program using a role (a service account). Policies say which actions a principal may perform on which resources. Clouds evaluate them in the same spirit: everything is denied unless something allows it, and an explicit deny always wins. Here is a tiny version of that logic: ทุกการเรียก API ของคลาวด์ทำโดยตัวตนหนึ่งที่เรียกว่า principal ซึ่งอาจเป็นคน หรือโปรแกรมที่ใช้ role (service account) policy บอกว่า principal ทำ action ใดกับทรัพยากรใดได้บ้าง คลาวด์ประเมินด้วยหลักเดียวกัน คือทุกอย่างถูกปฏิเสธ เว้นแต่มีสิ่งที่อนุญาต และการปฏิเสธอย่างชัดแจ้ง (explicit deny) ชนะเสมอ นี่คือตรรกะนั้นในแบบย่อ
| Ruleหลักการ | In practiceในทางปฏิบัติ |
|---|---|
| Least privilegeสิทธิ์น้อยที่สุด | give each identity only the actions and resources it needs; widen later if neededให้แต่ละตัวตนเฉพาะ action และทรัพยากรที่จำเป็น ค่อยขยายภายหลังถ้าต้องการ |
| Roles, not keysใช้ role ไม่ใช่กุญแจ | programs on cloud machines get short-lived credentials from a role; no long-lived keys in codeโปรแกรมบนเครื่องในคลาวด์ได้ข้อมูลยืนยันตัวตนอายุสั้นจาก role ไม่มีกุญแจอายุยาวในโค้ด |
| Protect the root accountปกป้องบัญชี root | turn on MFA, don't use it day to day, create named users or single sign-on insteadเปิด MFA ไม่ใช้ในงานประจำวัน แล้วสร้างผู้ใช้ที่มีชื่อหรือใช้ single sign-on แทน |
Lesson 6 · Building blocksบทที่ 6 · ส่วนประกอบ
Cloud networksเครือข่ายบนคลาวด์
A virtual private cloud (VPC on AWS and Google Cloud, VNet on Azure) is your own private network inside the cloud, with an address range you choose, like 10.0.0.0/16. You divide it into subnets. A public subnet has a route to the internet (for load balancers); a private subnet doesn't (for app servers and databases), and reaches out only through a NAT gateway. The subnet maths is the same as in the Networking guide:
virtual private cloud (VPC บน AWS และ Google Cloud, VNet บน Azure) คือเครือข่ายส่วนตัวของเราภายในคลาวด์ โดยเลือกช่วง address เอง เช่น 10.0.0.0/16 แล้วแบ่งเป็น ซับเน็ต ซับเน็ต สาธารณะ มีเส้นทางออกอินเทอร์เน็ต (สำหรับ load balancer) ส่วนซับเน็ต ส่วนตัว ไม่มี (สำหรับเซิร์ฟเวอร์แอปและฐานข้อมูล) และออกไปข้างนอกได้ผ่าน NAT gateway เท่านั้น การคำนวณซับเน็ตเหมือนใน คู่มือ Networking
One public and one private subnet per zone, three zones: the usual layout. Private subnets are made big because that's where the servers and containers live. Traffic is then filtered by security groups (AWS), network security groups (Azure) or firewall rules (Google Cloud): lists of allowed ports and sources, with everything else dropped, exactly like the firewall in the Networking guide. ซับเน็ตสาธารณะหนึ่งวงและส่วนตัวหนึ่งวงต่อ zone รวมสาม zone คือรูปแบบที่ใช้กันทั่วไป ซับเน็ตส่วนตัวทำให้ใหญ่ เพราะเป็นที่อยู่ของเซิร์ฟเวอร์และ container จากนั้นการรับส่งข้อมูลจะถูกกรองด้วย security group (AWS), network security group (Azure) หรือ firewall rule (Google Cloud) ซึ่งเป็นรายการพอร์ตและต้นทางที่อนุญาต ที่เหลือถูกทิ้งทั้งหมด เหมือนไฟร์วอลล์ในคู่มือ Networking
Lesson 7 · Building blocksบทที่ 7 · ส่วนประกอบ
Computeการประมวลผล
There are three main ways to run code, from most control to least work: วิธีหลักในการรันโค้ดมีสามแบบ เรียงจากควบคุมได้มากที่สุดไปถึงทำงานน้อยที่สุด
| Optionทางเลือก | Good forเหมาะกับ | Watch out forข้อควรระวัง |
|---|---|---|
| Virtual machinesVirtual machine | anything; old software; full control of the OSทุกอย่าง ซอฟต์แวร์เก่า และควบคุมระบบปฏิบัติการได้เต็มที่ | you patch and scale them; you pay while they're on, busy or notต้องแพตช์และขยายเอง และจ่ายตลอดที่เปิดไว้ ไม่ว่าจะมีงานหรือไม่ |
| ContainersContainer | most web apps and APIs; the same image everywhere (Docker, Kubernetes, or a simpler container platform)เว็บแอปและ API ส่วนใหญ่ image เดียวกันใช้ได้ทุกที่ (Docker, Kubernetes หรือแพลตฟอร์ม container ที่ง่ายกว่า) | Kubernetes itself is a lot to run; start with a managed platformการดูแล Kubernetes เองเป็นงานใหญ่ ควรเริ่มจากแพลตฟอร์มแบบ managed |
| Functionsฟังก์ชัน | short tasks triggered by events: an upload, a message, a schedule, an HTTP callงานสั้นๆ ที่ถูกเรียกด้วยเหตุการณ์ เช่น การอัปโหลด ข้อความ ตารางเวลา หรือการเรียก HTTP | time limits, "cold starts" after idle, and hard-to-predict bills at very high volumeมีเวลาจำกัด มี "cold start" หลังว่างนาน และค่าใช้จ่ายคาดเดายากเมื่อปริมาณสูงมาก |
Autoscaling adds machines or containers when load rises and removes them when it falls, based on CPU, requests or queue length. It's the "elastic" in Lesson 1, and the main reason the cloud can be cheaper than owning servers: you stop paying for capacity you only need at peak. Autoscaling เพิ่มเครื่องหรือ container เมื่อโหลดสูงขึ้น และลดลงเมื่อโหลดต่ำลง โดยอิงจาก CPU จำนวนคำขอ หรือความยาวของคิว นี่คือความ "ยืดหยุ่น" ในบทที่ 1 และเป็นเหตุผลหลักที่คลาวด์ถูกกว่าการมีเซิร์ฟเวอร์เอง เพราะไม่ต้องจ่ายค่ากำลังเครื่องที่ต้องใช้เฉพาะช่วงพีก
Lesson 8 · Building blocksบทที่ 8 · ส่วนประกอบ
Storage and databasesที่เก็บข้อมูลและฐานข้อมูล
| Kindประเภท | What it isคืออะไร | Use it forใช้สำหรับ |
|---|---|---|
| Object storageObject storage | files ("objects") in buckets, read and written over HTTP; practically unlimited and very durableไฟล์ ("object") ใน bucket อ่านเขียนผ่าน HTTP แทบไม่จำกัดขนาดและทนทานมาก | uploads, images, backups, logs, static websitesไฟล์อัปโหลด รูปภาพ ข้อมูลสำรอง log และเว็บไซต์แบบ static |
| Block storageBlock storage | a virtual disk attached to one VMดิสก์เสมือนที่ต่อกับ VM หนึ่งเครื่อง | the VM's operating system, a self-run databaseระบบปฏิบัติการของ VM และฐานข้อมูลที่ดูแลเอง |
| File storageFile storage | a shared network folder (NFS/SMB) many machines can mountโฟลเดอร์เครือข่ายที่ใช้ร่วมกัน (NFS/SMB) ซึ่งหลายเครื่อง mount ได้ | older apps that expect a shared diskแอปรุ่นเก่าที่ต้องการดิสก์ร่วม |
| Managed SQL databaseฐานข้อมูล SQL แบบ managed | PostgreSQL or MySQL run for you, with backups, patches and a standby in another zonePostgreSQL หรือ MySQL ที่มีคนรันให้ พร้อมการสำรองข้อมูล แพตช์ และเครื่องสำรองในอีก zone | most application dataข้อมูลของแอปพลิเคชันส่วนใหญ่ |
| NoSQL databaseฐานข้อมูล NoSQL | key-value or document stores that scale very farที่เก็บแบบ key-value หรือ document ที่ขยายได้มาก | sessions, carts, huge simple tables, global appssession ตะกร้าสินค้า ตารางขนาดใหญ่ที่เรียบง่าย และแอประดับโลก |
Object storage is often quoted at "eleven nines" of durability: the chance of losing a file is tiny, because copies are kept in several zones. Its availability (being able to read it right now) is a separate, lower number. Durability doesn't protect you from deleting a file yourself: turn on versioning and keep backups.object storage มักถูกอ้างว่ามี ความทนทาน "เก้าสิบเอ็ดตัว" คือโอกาสที่ไฟล์จะ หายไป น้อยมาก เพราะเก็บสำเนาไว้หลาย zone ส่วน ความพร้อมใช้งาน (อ่านได้ทันที) เป็นอีกตัวเลขหนึ่งที่ต่ำกว่า ความทนทานไม่ได้ป้องกันการที่เราลบไฟล์เอง ให้เปิด versioning และเก็บข้อมูลสำรองไว้
Lesson 9 · Money and mapsบทที่ 9 · เงินและแผนที่
Costค่าใช้จ่าย
Cloud bills come from a few meters: compute time (per second or hour), storage (per GB per month), requests, and data transfer out of the cloud (per GB). Data coming in is usually free; data going out to the internet is not, and it surprises many teams. Here's an example month with three small VMs, 500 GB of files and 2 TB downloaded by users: ค่าใช้จ่ายของคลาวด์มาจากมิเตอร์ไม่กี่ตัว ได้แก่ เวลาประมวลผล (ต่อวินาทีหรือชั่วโมง) ที่เก็บข้อมูล (ต่อ GB ต่อเดือน) จำนวนคำขอ และ ข้อมูลที่ส่งออก จากคลาวด์ (ต่อ GB) ข้อมูลขาเข้ามักไม่เสียเงิน แต่ข้อมูลขาออกไปยังอินเทอร์เน็ตเสียเงิน และทำให้หลายทีมประหลาดใจ นี่คือตัวอย่างหนึ่งเดือนที่มี VM ขนาดเล็กสามเครื่อง ไฟล์ 500 GB และผู้ใช้ดาวน์โหลด 2 TB
In this example the data leaving the cloud costs more than the servers. A CDN, compression and caching cut it. ในตัวอย่างนี้ข้อมูลที่ออกจากคลาวด์มีค่าใช้จ่ายมากกว่าเซิร์ฟเวอร์ CDN การบีบอัด และการแคชช่วยลดได้
| Way to payวิธีจ่าย | Fitsเหมาะกับ |
|---|---|
| On demandOn demand | new or changing workloads; full price, no promiseงานใหม่หรืองานที่เปลี่ยนบ่อย จ่ายราคาเต็ม ไม่มีข้อผูกมัด |
| Commitmentsการผูกมัดระยะยาว | steady workloads; promise 1 or 3 years of use for a large discount (reserved instances, savings plans, committed use)งานที่คงที่ สัญญาว่าจะใช้ 1 หรือ 3 ปีเพื่อรับส่วนลดมาก (reserved instance, savings plan, committed use) |
| Spot / preemptibleSpot / preemptible | spare capacity at a deep discount that can be taken back at short notice: batch jobs, CI runnersกำลังเครื่องที่เหลือในราคาลดมาก แต่อาจถูกเรียกคืนในเวลาอันสั้น เหมาะกับงาน batch และ CI runner |
Before creating anything, set a budget with an email alert. Then tag resources by project, and delete what you don't use: forgotten test machines, unattached disks and old snapshots are the classic waste.ก่อนสร้างอะไร ให้ตั้ง งบประมาณพร้อมการแจ้งเตือนทางอีเมล จากนั้นติดแท็กทรัพยากรตามโปรเจกต์ และลบสิ่งที่ไม่ใช้ เครื่องทดสอบที่ลืมไว้ ดิสก์ที่ไม่ได้ต่อกับเครื่อง และ snapshot เก่าคือการสิ้นเปลืองแบบคลาสสิก
Lesson 10 · Money and mapsบทที่ 10 · เงินและแผนที่
The same thing on AWS, Azure and Google Cloudสิ่งเดียวกันบน AWS, Azure และ Google Cloud
Once you know the idea, a new cloud is mostly new names. Some equivalents are close rather than exact. เมื่อเข้าใจแนวคิดแล้ว คลาวด์ใหม่ส่วนใหญ่ก็แค่ชื่อใหม่ บางบริการเทียบได้ใกล้เคียง ไม่ได้เหมือนกันทุกประการ
| Ideaแนวคิด | AWS | Azure | Google Cloud |
|---|---|---|---|
| virtual machinesvirtual machine | EC2 | Virtual Machines | Compute Engine |
| managed KubernetesKubernetes แบบ managed | EKS | AKS | GKE |
| simple container platformแพลตฟอร์ม container แบบง่าย | ECS on Fargate, App Runner | Container Apps | Cloud Run |
| functionsฟังก์ชัน | Lambda | Functions | Cloud Run functions |
| object storageobject storage | S3 | Blob Storage | Cloud Storage |
| block storageblock storage | EBS | Managed Disks | Persistent Disk |
| managed SQLSQL แบบ managed | RDS, Aurora | Azure Database for PostgreSQL/MySQL, Azure SQL | Cloud SQL, AlloyDB |
| NoSQLNoSQL | DynamoDB | Cosmos DB | Firestore, Bigtable |
| message queueคิวข้อความ | SQS, SNS | Service Bus, Queue Storage | Pub/Sub |
| private networkเครือข่ายส่วนตัว | VPC | Virtual Network (VNet) | VPC |
| firewallไฟร์วอลล์ | Security groups | Network security groups | Firewall rules |
| identity and accessตัวตนและสิทธิ์ | IAM | Entra ID + Azure RBAC | IAM |
| DNS / CDNDNS / CDN | Route 53 / CloudFront | Azure DNS / Front Door | Cloud DNS / Cloud CDN |
| monitoring and logsการติดตามและ log | CloudWatch | Azure Monitor | Cloud Monitoring, Cloud Logging |
| infrastructure as codeinfrastructure as code | CloudFormation | Bicep / ARM templates | Infrastructure Manager |
Terraform (or OpenTofu) works with all three, which is why many teams use it for infrastructure as code. The provider guides in this series run each cloud's own tools against local emulators, so you can practise without an account or a bill. Terraform (หรือ OpenTofu) ใช้ได้กับทั้งสามคลาวด์ หลายทีมจึงใช้มันทำ infrastructure as code คู่มือของแต่ละผู้ให้บริการในชุดนี้จะรันเครื่องมือของคลาวด์นั้นกับ emulator ในเครื่อง จึงฝึกได้โดยไม่ต้องมีบัญชีและไม่มีค่าใช้จ่าย
Lesson 11 · Your turnบทที่ 11 · ถึงตาคุณแล้ว
Practiceแบบฝึกหัด
1. Three zones1. สาม zone
How available is the app from Lesson 3 with VMs in three zones, and how many minutes a month is that? Then make the database the weakest link: what happens if it has two copies in two zones?แอปจากบทที่ 3 พร้อมใช้งานแค่ไหนเมื่อมี VM ในสาม zone และเท่ากับกี่นาทีต่อเดือน จากนั้นลองดูจุดอ่อนที่สุดคือฐานข้อมูล ถ้ามันมีสองชุดในสอง zone จะเป็นอย่างไร
2. Let uploaders tidy up2. ให้ผู้อัปโหลดลบไฟล์ได้
Change the policy from Lesson 5 so s3:DeleteObject is allowed in photos/uploads/ only. Test a delete in uploads, one in the top folder, and one in private.แก้ policy จากบทที่ 5 ให้อนุญาต s3:DeleteObject เฉพาะใน photos/uploads/ แล้วทดสอบการลบใน uploads ในโฟลเดอร์บนสุด และใน private
Lesson 12 · Avoiding troubleบทที่ 12 · หลีกเลี่ยงปัญหา
Common mistakesข้อผิดพลาดที่พบบ่อย
These are the mistakes behind most cloud incidents and surprise bills. The examples are written in the style of AWS; the same settings exist on every cloud. นี่คือข้อผิดพลาดเบื้องหลังเหตุการณ์และค่าใช้จ่ายที่ไม่คาดคิดบนคลาวด์ส่วนใหญ่ ตัวอย่างเขียนในรูปแบบของ AWS แต่การตั้งค่าแบบเดียวกันมีในทุกคลาวด์
Access keys in the codeกุญแจเข้าถึงอยู่ในโค้ด
Keys committed to Git get found by bots within minutes and used to run crypto miners on your bill. Programs in the cloud should use a role; on your laptop, use your own short-lived login.กุญแจที่ถูก commit ลง Git จะถูกบอตพบภายในไม่กี่นาที และถูกใช้รันเครื่องขุดคริปโตบนบิลของเรา โปรแกรมในคลาวด์ควรใช้ role ส่วนบนโน้ตบุ๊กให้ใช้การล็อกอินอายุสั้นของเราเอง
SSH open to the whole internetเปิด SSH ให้ทั้งอินเทอร์เน็ต
0.0.0.0/0 means "from anywhere". Bots scan every public address all day; an open port 22 gets password attempts within minutes.0.0.0.0/0 แปลว่า "จากที่ไหนก็ได้" บอตสแกนทุก address สาธารณะตลอดทั้งวัน พอร์ต 22 ที่เปิดไว้จะถูกลองรหัสผ่านภายในไม่กี่นาที
A public bucket for private filesbucket สาธารณะสำหรับไฟล์ส่วนตัว
Leaked customer data very often comes from storage set to public "for a quick test". Keep buckets private (the default on new buckets) and hand out short-lived signed links when someone needs one file.ข้อมูลลูกค้าที่รั่วไหลมักมาจากที่เก็บข้อมูลที่ถูกตั้งเป็นสาธารณะ "เพื่อทดสอบเร็วๆ" ให้เก็บ bucket เป็นส่วนตัว (ค่าเริ่มต้นของ bucket ใหม่) และให้ลิงก์ที่ลงนามแล้วอายุสั้นเมื่อมีคนต้องการไฟล์เดียว
Everything in one zoneทุกอย่างอยู่ใน zone เดียว
It's cheaper and simpler until that zone has a bad day. Lesson 3's lab shows what a second zone is worth.ถูกกว่าและง่ายกว่า จนกว่า zone นั้นจะมีปัญหา แล็บในบทที่ 3 แสดงว่า zone ที่สองมีคุณค่าแค่ไหน
No budget alertไม่มีการแจ้งเตือนงบประมาณ
A loop that writes to storage, a forgotten GPU machine or a sudden download spike can cost more in a weekend than a month of normal use. An alert can't stop it, but it tells you on Saturday instead of at the end of the month.ลูปที่เขียนลงที่เก็บข้อมูลไม่หยุด เครื่อง GPU ที่ลืมปิด หรือการดาวน์โหลดที่พุ่งขึ้นกะทันหัน อาจเสียเงินในหนึ่งสุดสัปดาห์มากกว่าการใช้งานปกติทั้งเดือน การแจ้งเตือนหยุดมันไม่ได้ แต่บอกเราในวันเสาร์ แทนที่จะเป็นตอนสิ้นเดือน
Lesson 13 · Referenceบทที่ 13 · อ้างอิง
Glossaryคำศัพท์
| English | ไทย | Meaningความหมาย |
|---|---|---|
| region / zone | รีเจียน / โซน | A geographic area / one independent data centre in itพื้นที่ทางภูมิศาสตร์ / ศูนย์ข้อมูลอิสระหนึ่งแห่งในพื้นที่นั้น |
| IaaS / PaaS / SaaS | IaaS / PaaS / SaaS | Rent machines / a platform / a finished appเช่าเครื่อง / เช่าแพลตฟอร์ม / ใช้แอปสำเร็จรูป |
| serverless | เซิร์ฟเวอร์เลส | You run code without managing servers; billed per useรันโค้ดโดยไม่ต้องดูแลเซิร์ฟเวอร์ คิดเงินตามการใช้ |
| SLA | SLA | The provider's availability promise, with credits if missedคำสัญญาเรื่องความพร้อมใช้งานของผู้ให้บริการ พร้อมเครดิตถ้าทำไม่ได้ |
| high availability | ความพร้อมใช้งานสูง | Staying up when one part fails, usually by spreading over zonesยังทำงานได้เมื่อส่วนหนึ่งล้ม มักทำโดยกระจายไปหลาย zone |
| principal / role | principal / role | Who makes a call / an identity programs assumeผู้เรียก API / ตัวตนที่โปรแกรมสวมบทบาท |
| policy | นโยบาย | Rules of which actions are allowed on which resourcesกฎว่า action ใดทำได้กับทรัพยากรใด |
| least privilege | สิทธิ์น้อยที่สุด | Only the permissions really neededให้เฉพาะสิทธิ์ที่จำเป็นจริงๆ |
| VPC / VNet / subnet | VPC / VNet / ซับเน็ต | Your private network in the cloud / a part of itเครือข่ายส่วนตัวของเราในคลาวด์ / ส่วนหนึ่งของเครือข่ายนั้น |
| security group | security group | A firewall attached to resourcesไฟร์วอลล์ที่ผูกกับทรัพยากร |
| autoscaling | การขยายอัตโนมัติ | Adding and removing capacity with the loadเพิ่มและลดกำลังเครื่องตามโหลด |
| bucket / object | บัคเก็ต / ออบเจกต์ | A container in object storage / a file in itภาชนะใน object storage / ไฟล์ในนั้น |
| egress | ข้อมูลขาออก | Data leaving the cloud, usually billed per GBข้อมูลที่ออกจากคลาวด์ มักคิดเงินต่อ GB |
| infrastructure as code | infrastructure as code | Describing cloud resources in files that tools applyการอธิบายทรัพยากรบนคลาวด์ในไฟล์ แล้วให้เครื่องมือสร้างตาม |