{"id":"l-aws-1-1","courseId":"aws-cloud-foundations","lang":"en","kind":"intro","summary":"Describe what a cloud provider actually sells, what moving to AWS fixes and what it leaves for you, using Lantern’s one-server setup as the case study.","html":"<p>Lantern is a community events website. Organisers post events, people RSVP, and every event has a poster image. Today it runs on one rented server: a Node.js app, a PostgreSQL database and a folder of uploaded posters, all on the same disk. A nightly cron job copies the database dump to, yes, that same disk.</p>\n<p>It has worked for three years. Then a street-food festival got shared widely, traffic jumped twenty-fold for an evening, the server ran out of memory, and the site went down at exactly the moment it mattered. Two weeks later the disk filled up with poster uploads and the database refused writes. Lantern’s maintainers want to move to AWS, and this course is that move, done properly.</p>\n<h2 id=\"sec-1\" tabindex=\"-1\">What you are actually renting</h2>\n<p>A cloud provider sells capacity and services that you create, change and delete through an API, and pay for by usage. Behind every console button is an API call, which is why everything you click in this course you can also script.</p>\n<p>That capacity comes at different levels of “how much do you manage”:</p>\n<div class=\"table-wrap\" role=\"region\" aria-label=\"Scrollable table\" tabindex=\"0\"><table><thead>\n<tr>\n<th>You get</th>\n<th>AWS example</th>\n<th>You still manage</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>A virtual machine</td>\n<td>Amazon EC2</td>\n<td>OS patches, runtime, app, scaling</td>\n</tr>\n<tr>\n<td>A managed database</td>\n<td>Amazon RDS</td>\n<td>Schema, queries, who can connect</td>\n</tr>\n<tr>\n<td>A function that runs on demand</td>\n<td>AWS Lambda</td>\n<td>Your code and its permissions</td>\n</tr>\n<tr>\n<td>Object storage</td>\n<td>Amazon S3</td>\n<td>What you store and who can read it</td>\n</tr>\n</tbody>\n</table></div><p>The further down the table you go, the less undifferentiated work you do, and the more you are shaped by how that service works.</p>\n<figure class=\"diagram\"><svg class=\"diagram-svg\" focusable=\"false\" viewBox=\"0 0 680 270\" role=\"img\" aria-labelledby=\"l-aws-1-1-t1\"><defs><marker id=\"arrow-l-aws-1-1-1\" viewBox=\"0 0 10 10\" refX=\"9\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0 L10 5 L0 10 z\" class=\"d-arrowhead\"/></marker></defs>\n  <title id=\"l-aws-1-1-t1\">Today, the app, database and posters share one server. On AWS, the site is served by CloudFront from S3, the API runs on Lambda, data lives in a managed database and posters in S3.</title>\n  <text class=\"d-label-strong\" x=\"120\" y=\"28\" text-anchor=\"middle\">Today: one server</text>\n  <rect class=\"d-box-warn\" x=\"30\" y=\"44\" width=\"180\" height=\"200\" rx=\"12\"/>\n  <rect class=\"d-box\" x=\"50\" y=\"64\" width=\"140\" height=\"44\" rx=\"8\"/>\n  <text class=\"d-label\" x=\"120\" y=\"91\" text-anchor=\"middle\">Node.js app</text>\n  <rect class=\"d-box\" x=\"50\" y=\"122\" width=\"140\" height=\"44\" rx=\"8\"/>\n  <text class=\"d-label\" x=\"120\" y=\"149\" text-anchor=\"middle\">PostgreSQL</text>\n  <rect class=\"d-box\" x=\"50\" y=\"180\" width=\"140\" height=\"44\" rx=\"8\"/>\n  <text class=\"d-label\" x=\"120\" y=\"207\" text-anchor=\"middle\">Posters + backups</text>\n  <path class=\"d-arrow\" d=\"M230 144 L290 144\" marker-end=\"url(#arrow-l-aws-1-1-1)\"/>\n  <text class=\"d-label-strong\" x=\"480\" y=\"28\" text-anchor=\"middle\">On AWS: one job per service</text>\n  <rect class=\"d-box-accent\" x=\"310\" y=\"54\" width=\"160\" height=\"44\" rx=\"8\"/>\n  <text class=\"d-label\" x=\"390\" y=\"81\" text-anchor=\"middle\">CloudFront</text>\n  <rect class=\"d-box-primary\" x=\"500\" y=\"54\" width=\"160\" height=\"44\" rx=\"8\"/>\n  <text class=\"d-label\" x=\"580\" y=\"81\" text-anchor=\"middle\">S3: site files</text>\n  <rect class=\"d-box-primary\" x=\"310\" y=\"134\" width=\"160\" height=\"44\" rx=\"8\"/>\n  <text class=\"d-label\" x=\"390\" y=\"161\" text-anchor=\"middle\">Lambda: API</text>\n  <rect class=\"d-box-success\" x=\"500\" y=\"134\" width=\"160\" height=\"44\" rx=\"8\"/>\n  <text class=\"d-label\" x=\"580\" y=\"161\" text-anchor=\"middle\">Managed database</text>\n  <rect class=\"d-box-primary\" x=\"405\" y=\"206\" width=\"160\" height=\"44\" rx=\"8\"/>\n  <text class=\"d-label\" x=\"485\" y=\"233\" text-anchor=\"middle\">S3: posters</text>\n  <path class=\"d-arrow\" d=\"M470 76 L496 76\" marker-end=\"url(#arrow-l-aws-1-1-1)\"/>\n  <path class=\"d-arrow\" d=\"M390 98 L390 130\" marker-end=\"url(#arrow-l-aws-1-1-1)\"/>\n  <path class=\"d-arrow\" d=\"M470 156 L496 156\" marker-end=\"url(#arrow-l-aws-1-1-1)\"/>\n</svg><figcaption>Lantern today versus Lantern on AWS</figcaption></figure>\n<h2 id=\"sec-2\" tabindex=\"-1\">What the cloud isn’t</h2>\n<p>It isn’t automatically reliable. If you copy Lantern’s single server onto a single EC2 instance, it fails exactly as before: one machine, one disk, one place. AWS makes the better design cheap to build; it doesn’t build it for you.</p>\n<p>It isn’t automatically cheaper. You pay for what you provision, not what you use well. A forgotten test database runs all month. Data sent out to the internet is metered. Many small teams move to AWS and get a surprise bill in month two because nobody set a budget.</p>\n<p>It isn’t automatically secure. AWS secures the buildings, hardware and the software that runs its services. You decide who can sign in, what each piece of code may touch, and whether a bucket is private. Lesson three makes that split precise.</p>\n<aside class=\"callout callout-mistake\" role=\"note\"><p class=\"callout-title\"><svg class=\"icon \" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\"/><path d=\"M12 9v4\"/><path d=\"M12 17h.01\"/></svg><span><span class=\"callout-kind\">Common mistake</span><span class=\"callout-sep\" aria-hidden=\"true\"> · </span>Treating the free credits as “free AWS”</span></p>\n<p>New accounts start with promotional credits and some services have monthly free usage. That is a trial, not a hosting plan. The first thing you build in this course is a budget alert, before anything that costs money.</p>\n</aside>\n<h2 id=\"sec-3\" tabindex=\"-1\">How this course runs</h2>\n<p>You will follow Lantern from a bare account to a production setup. Section one covers where AWS runs your things, who is responsible for what, and how to lock the account down and drive it from the terminal. Section two is identity: who and what may do which actions. Section three picks the right compute, storage, database and network pieces. Section four builds and ships the new Lantern, then measures it.</p>\n<p>Two habits run through every lesson. Before you create anything, ask “what will this cost while it sits there?” and “who can reach it?” If you can answer both, you understand the design. Next up: where, physically, all of this runs.</p>\n","toc":[{"id":"sec-1","text":"What you are actually renting","level":2},{"id":"sec-2","text":"What the cloud isn’t","level":2},{"id":"sec-3","text":"How this course runs","level":2}],"takeaways":["The cloud is rented computing capacity and managed services that you create, change and delete through an API, and pay for by usage.","Moving to AWS removes hardware chores but not design work; a single server in AWS fails in exactly the same ways as a single server anywhere else.","AWS bills by the second, hour, gigabyte or request, so anything you leave running keeps costing money until you delete it.","Security in the cloud is shared; AWS secures the data centres, and you secure what you configure and upload."],"further":[{"title":"What is cloud computing?","url":"https://aws.amazon.com/what-is-cloud-computing/"},{"title":"Overview of Amazon Web Services – Six advantages of cloud computing","url":"https://docs.aws.amazon.com/whitepapers/latest/aws-overview/six-advantages-of-cloud-computing.html"}],"quiz":[{"q":"<p>Lantern’s single server crashed when an event went viral. Which statement about moving it to one Amazon EC2 instance is accurate?</p>","options":[{"text":"It will survive the next spike, because AWS scales every instance automatically.","why":"An EC2 instance is a fixed-size virtual machine. Nothing scales unless you design for it, for example with Auto Scaling or a CDN."},{"text":"It will fail in the same way, because one server is still one server, wherever it runs.","why":"Correct. The cloud makes better designs cheap and quick to build, but a lift-and-shift of one box keeps the one-box failure modes."},{"text":"It cannot fail, because AWS guarantees 100% uptime for EC2.","why":"No AWS service promises 100%. Service level agreements give credits when availability drops below a published percentage."}],"answer":1},{"q":"<p>Which pricing idea best describes most AWS services?</p>","options":[{"text":"A fixed monthly fee per account that covers all usage.","why":"That is how a lot of shared hosting works, not AWS. AWS meters each resource separately."},{"text":"A one-off purchase of hardware that AWS hosts for you.","why":"You never buy the hardware. Even long-term commitments such as Savings Plans are discounts on usage, not purchases."},{"text":"Metered usage, such as instance-seconds, gigabytes stored, requests made and data sent out to the internet.","why":"Correct. That is why idle resources still cost money and why a budget alert is one of the first things you set up."}],"answer":2},{"q":"<p>After the move, who is responsible for the S3 bucket that Lantern’s posters live in being private?</p>","options":[{"text":"Lantern, because access settings are configuration that the customer controls.","why":"Correct. AWS gives you safe defaults and tools, but who you grant access to is always your decision and your responsibility."},{"text":"AWS, because S3 is a managed service.","why":"Managed means AWS runs the servers and software. It does not decide who should read your data."},{"text":"Nobody, because S3 buckets cannot be made public.","why":"New buckets block public access by default, but an owner can still turn that off and publish objects."}],"answer":0}],"exercise":{"kind":"choice","multiple":true,"options":["spike","disk","backups","bugs","costs"],"correct":["disk","backups"],"title":"What does the move really fix?","prompt":"<p>Lantern’s maintainers list five problems with their single server. Suppose they move to AWS with a better design: posters in Amazon S3 and the database on a managed service with automated backups, but the app still on <strong>one</strong> EC2 instance. Select every problem that this move actually solves.</p>\n","hints":["Ask of each problem: is it caused by the hardware layout, or by the design and code?","A managed service changes who runs the storage and the backups. It changes nothing about how many app servers you have.","Two problems go away because the data no longer lives on one disk. The others need a different design or different habits."],"explanation":"<p>Moving posters to S3 removes the full-disk problem, because S3 grows without you provisioning space. Automated backups on a managed database are stored separately from the database server, so a dead disk no longer takes the backups with it. The traffic spike is still a one-instance problem until you add a CDN, more instances or serverless pieces. Bugs in the Node.js code move with the code. And costs only fall if someone watches them; the cloud makes over-spending easier, not harder.</p>\n","checkLabels":{},"optionText":{"spike":{"text":"The site falls over when one event goes viral.","why":"Not solved. The app still runs on one fixed-size instance. You fix this with caching at the edge, more capacity or serverless pieces, which section four builds."},"disk":{"text":"Poster uploads fill the server’s disk.","why":"Solved. Amazon S3 has no disk to fill; you pay per gigabyte stored instead of provisioning space up front."},"backups":{"text":"Database backups live on the same disk as the database.","why":"Solved. A managed database’s automated backups are kept apart from the instance, so losing the server does not lose the backups."},"bugs":{"text":"A memory leak in the Node.js app needs a restart every few days.","why":"Not solved. Your code comes with you. The cloud can restart things automatically, but the leak is still yours to fix."},"costs":{"text":"Nobody knows what the hosting costs each month.","why":"Not solved by moving. AWS bills are detailed but only useful if you set budgets and look at them, which lesson three sets up."}}},"words":559,"readMinutes":3}