AWS Instance LifeCycle
- Instance States

- pending:
- This is a transition state preparing to enter running state
- You will not be billed in this state
- running:
- The instance is ready & running
- You will be billed in this state
- stopping:
- This is a transition state to perpare for stopped or stop-hibernate
- You will not be billed for stopped but billed for hibernation
- Stopped:
- The instance is shutdown
- No billing
- Shutting down:
- Tranisition state for terminated
- Not billed
- Terminated:
- Instance is permanently removed
- Not billed
- Note: This doesnot apply for reservations.
AWS Instance Purchasing Options
- AWS provides the following instance purchase options
- On-Demand Instance:
- Pay by second/hour of instance usage
- Savings-Plan
- Reserved Instances (RI):
- In Reserved instance model, we give commitment to amazon on particular instance type for a period of 1 or 3 years
- Payment can be made
- Complete upfront
- Partial Upfront
- Pay as you go
- Amazon gives the following flexibility in Reserved Instances
- AZ flexibility: The RI instance discount applies to instance usage in any AZ in the specified region
- Instance size flexibility: RI discount applies to instance usage within instance family regardless of size (Supported on Amazon linux/Unix instances)
- Spot Instances:
- We can reserve the unused hardware in AZ’s at very less cost
- We can bid for a price of ec2 instance type with some price (usually very less)
- when the ec2 instance type prices is equal to your bid price ec2 instance will be automatically created.
- Once the price of ec2 instance increases (due to other bids), then ec2 instance will be evicted from your account.
- Dedicated Hosts: EC2 dedicated host is a physical server with EC2 instance capacity fully dedicated to your use
- Dedicated Instances: Dedicated instances are ec2 instances that run on hardware dedicated to single customer
- Capacity Reservations

- On-Demand Instance:
Understanding ec2 pricing
- Scenario-1:
- My Team has to create test environment for the following architecture. You are asked to create an estimate of pricing
-
2 Web Servers: 2 VCPUs & 8GB of RAM
-
2 App Servers: 4 VCPUS & atleast 8 GB of RAM
-
2 db Servers: 4 VCPUS and 16 GB of RAM
-
- Since the environment is test, lets use general purpose compute
- Webserver (t2.large => 2)
- app server (t2.xlarge => 2)
- db server (t2.xlarge => 2)
- Lets create an estimate (excluding storage costs)
- Navigate to pricing calculator Refer Here
- On-demand estimate

- My Team has to create test environment for the following architecture. You are asked to create an estimate of pricing
- Scenario-2:
- Create the estimate for the same resource as in scenario 1 for production env
- Web Server: Compute optimized
- App Server: Compute Optimized
- Db Server: Storage Optimized
- Create the estimate for the same resource as in scenario 1 for production env
- Create estimates for Scenario 2 with
- Savings plan
- Reserved Instances partial upfront & Complete upfront and see the price differences.
