An Identity and Access Management (IAM) user is an entity that you create in AWS to represent the person or application that interacts with AWS resources
Even with administrative access, an IAM user cannot access billing data by default
Accessing billing data as an IAM user
1. Go to the root account
2. Go to Accounts
3. Activate IAM access to billing information
Billing console
The AWS Billing and Cost Management console, where you can view and manage your AWS costs and billing information
The billing console shows information such as month-to-date cost, total forecasted cost, and last month's total cost
Analyzing billing details
1. Go to the Bills section
2. Select the month of interest
3. Scroll down to see the charges by service
Free tier
AWS offers a free tier that allows customers to try out certain AWS services for free for a limited time
Setting up a budget
1. Go to the Budgets section
2. Create a budget using a template
3. Set the budget amount and email notifications
Setting up a zero spend budget and a monthly cost budget can help avoid unexpected costs
Amazon EC2
Elastic Compute Cloud, one of the most popular AWS offerings, allows you to rent virtual machines (EC2 instances)
Using EC2
1. Choose operating system (Linux, Windows, Mac OS)
2. Choose compute power (CPU, RAM, storage)
3. Choose network (speed, public IP, security group)
4. Configure with EC2 User Data script
EC2 instance
A virtual server running in the Amazon cloud
Launching an EC2 instance
1. Choose name and tags
2. Choose operating system (Amazon Linux 2)
3. Choose instance type (t2.micro)
4. Create key pair (EC2 Tutorial)
5. Configure network settings
6. Configure storage
7. Add user data script to launch web server
User data script is executed only on the first launch of the EC2 instance
Instance is stopped
Public IP address may change when instance is restarted
Private IP address remains the same when instance is stopped and restarted
Stopping an instance stops billing, but keeps the instance state
Terminating an instance deletes the instance and associated resources
EC2 Instance Types
Different types of EC2 instances that can be used for different use cases, with different types of optimization
Types of EC2 instances
General purpose
Compute optimized
Memory optimized
Storage optimized
Instance Class
The first part of the EC2 instance naming convention, e.g. M for general purpose
Instance Generation
The second part of the EC2 instance naming convention, e.g. 5 for the 5th generation
Instance Size
The third part of the EC2 instance naming convention, e.g. 2XLarge for the size
General purpose instances
Good balance between compute, memory, networking
Suitable for diverse workloads like web servers or code repositories
General purpose instances
T2 micro (free tier)
Compute optimized instances
Optimized for compute intensive tasks like batch processing, media transcoding, high-performance web servers, HPC, machine learning, gaming servers
Compute optimized instance naming
C5, C6, etc.
Memory optimized instances
High performance for workloads that process large datasets in memory, like databases, distributed caches, BI applications, real-time big data processing
Memory optimized instance naming
R series, X1 high memory, Z1
Storage optimized instances
Optimized for high-frequency online transactional processing, relational and NoSQL databases, caching for in-memory databases, data warehousing, distributed file systems
Storage optimized instance naming
I, G, H1 series
t2.micro is part of the AWS free tier, providing up to 750 hours per month
Website to compare EC2 instance types
instancetype.info
Security groups
Firewall around EC2 instances that control how traffic is allowed into and out of the instances
Security groups
Only contain allow rules
Can reference IP addresses or other security groups
How security groups work
1. Create security group around EC2 instance
2. Security group has inbound and outbound rules
3. Inbound rules control traffic from outside to instance
4. Outbound rules control traffic from instance to outside
Security groups are locked down to region/VPC combination