0
0
AWScloud~5 mins

Why cloud over on-premises in AWS - Why It Works

Choose your learning style9 modes available
Introduction
Choosing where to run your computer systems is important. Cloud means using someone else's big computers over the internet. On-premises means using your own computers at your place. Cloud helps you avoid buying and managing your own machines.
When you want to start a new app quickly without buying hardware.
When your app needs to grow or shrink fast depending on users.
When you want to pay only for the computers you use, not more.
When you want experts to handle security and backups for you.
When you want to access your app from anywhere easily.
Commands
This command shows your current cloud computers (called instances) running in AWS. It helps you see what you have without managing physical machines.
Terminal
aws ec2 describe-instances
Expected OutputExpected
{ "Reservations": [] }
This command starts a new small cloud computer instantly. You don't need to buy or set up hardware yourself.
Terminal
aws ec2 run-instances --image-id ami-0abcdef1234567890 --count 1 --instance-type t2.micro --key-name my-key --security-groups my-sg
Expected OutputExpected
{ "Instances": [ { "InstanceId": "i-1234567890abcdef0", "State": { "Name": "pending" } } ] }
--image-id - Specifies the operating system image to use.
--instance-type - Defines the size and power of the cloud computer.
This command stops and removes the cloud computer when you no longer need it, so you don't pay for unused machines.
Terminal
aws ec2 terminate-instances --instance-ids i-1234567890abcdef0
Expected OutputExpected
{ "TerminatingInstances": [ { "InstanceId": "i-1234567890abcdef0", "CurrentState": { "Name": "shutting-down" }, "PreviousState": { "Name": "running" } } ] }
--instance-ids - Specifies which cloud computer to stop.
Key Concept

If you remember nothing else from this pattern, remember: Cloud lets you use computers instantly without owning or managing physical machines.

Common Mistakes
Trying to run cloud commands without setting up AWS credentials.
The commands fail because AWS needs permission to act for you.
Set up AWS credentials using 'aws configure' before running commands.
Not terminating cloud instances when done.
You keep paying for machines you no longer use.
Always terminate instances with 'aws ec2 terminate-instances' to stop charges.
Summary
Use 'aws ec2 run-instances' to start cloud computers quickly without buying hardware.
Check running cloud computers with 'aws ec2 describe-instances'.
Stop and remove cloud computers with 'aws ec2 terminate-instances' to save money.