0
0
AWScloud~5 mins

Cloud service models (IaaS, PaaS, SaaS) in AWS - Commands & Configuration

Choose your learning style9 modes available
Introduction
Cloud service models help you choose how much control and responsibility you want over your computer resources. They solve the problem of setting up and managing servers, software, and data by offering different levels of service.
When you want to rent virtual machines and manage everything on them yourself.
When you want to deploy your app without worrying about the underlying servers.
When you want to use ready-made software online without installing anything.
When you want to quickly test a new app without buying hardware.
When you want to focus on your app code and leave infrastructure to the cloud provider.
Commands
This command launches a virtual server (EC2 instance) in AWS, showing how Infrastructure as a Service (IaaS) works by giving you control over a virtual machine.
Terminal
aws ec2 run-instances --image-id ami-0c94855ba95c71c99 --count 1 --instance-type t2.micro --key-name my-key --security-group-ids sg-0123456789abcdef0 --subnet-id subnet-0123456789abcdef0
Expected OutputExpected
{ "Instances": [ { "InstanceId": "i-0abcd1234efgh5678", "ImageId": "ami-0c94855ba95c71c99", "InstanceType": "t2.micro", "State": { "Code": 0, "Name": "pending" }, "SubnetId": "subnet-0123456789abcdef0", "SecurityGroups": [ { "GroupName": "default", "GroupId": "sg-0123456789abcdef0" } ] } ] }
--image-id - Specifies the operating system image for the virtual machine.
--instance-type - Defines the hardware resources like CPU and memory.
--count - Number of instances to launch.
This command creates a platform for your app using AWS Elastic Beanstalk, an example of Platform as a Service (PaaS) where AWS manages servers and you focus on your app.
Terminal
aws elasticbeanstalk create-application --application-name my-app
Expected OutputExpected
{ "Application": { "ApplicationName": "my-app", "DateCreated": "2024-06-01T12:00:00.000Z", "DateUpdated": "2024-06-01T12:00:00.000Z" } }
--application-name - Names your app platform.
This command creates a storage bucket in AWS S3, which is often used by SaaS apps to store user data without managing servers.
Terminal
aws s3 mb s3://my-saas-app-storage
Expected OutputExpected
make_bucket: my-saas-app-storage
This command lists all your S3 buckets, showing your SaaS storage resources.
Terminal
aws s3 ls
Expected OutputExpected
2024-06-01 12:00:00 my-saas-app-storage
Key Concept

If you remember nothing else, remember: IaaS gives you virtual machines to manage, PaaS gives you a ready platform for your app, and SaaS gives you software ready to use online.

Common Mistakes
Trying to manage servers in SaaS instead of using the software as is.
SaaS means the provider handles all infrastructure and software, so managing servers is unnecessary and impossible.
Use SaaS software directly without trying to control the underlying servers.
Using IaaS but expecting the cloud to handle app deployment automatically.
IaaS only provides virtual machines; you must install and manage your app yourself.
Use PaaS if you want the cloud to manage deployment and scaling.
Confusing PaaS with SaaS and trying to customize SaaS software like a platform.
SaaS is ready-made software with limited customization, unlike PaaS which lets you deploy your own apps.
Choose PaaS when you need to deploy custom apps; choose SaaS for ready-to-use software.
Summary
Use 'aws ec2 run-instances' to launch virtual machines in IaaS.
Use 'aws elasticbeanstalk create-application' to create app platforms in PaaS.
Use AWS S3 commands to manage storage often used by SaaS applications.