Server-based resources | Shared resources |
Web servers, databases | Queues, CDNs, ... |
EC2, RDS, ElastiCache | S3, SQS, CloudFront |
Pay by the hour | Pay per use |
Optimize | Don't worry about it |
t2.small | $0.74/day |
t2.medium | $1.46/day |
t2.large | $2.88/day |
t2.xlarge | $5.86/day |
c4.4xlarge | $23.93/day |
SSD gp2, 10 GB | $1.20/month |
aws ec2 start-instances --instance-ids i-1234567890 // poll for started state: aws ec2 describe-instances --instance-id i-1234567890 // poll with ssh that you can connect // (optionally) poll for some smoke test to pass // update DNS with new public ipStopping an instance is easy, restarting it is more difficult. Actually I do this with Python, but I show it with the cli since it's universal.
aws ec2 stop-instances --instance-ids i-1234567890 // poll for stopped state: aws ec2 describe-instances --instance-ids i-1234567890
Error: InsufficientInstanceCapacity