AWS Operations Guide
A step-by-step reference for working with core AWS services: EC2, S3 IAM, Security Groups, and CloudWatch.
Getting Into AWS
Logging In (AWS Academy)
- Go to
https://awsacademy.instructure.com/login/canvas - Log in with your student email (
lastnamef@students.westerntc.edu) - From the Dashboard, select AWS Academy Learner Lab
- In the left menu, select Modules
- Click Launch AWS Academy Learner Lab
- Click Start Lab at the top — wait for the circle next to "AWS" to turn green
- Click AWS on the left to open the AWS Management Console
- When done, click End Lab to stop the environment and avoid unnecessary charges
Note: Every time you return, you must restart the lab from step 6. The environment does not persist between sessions.
Getting Your AWS Credentials (for CLI/GitHub Actions)
- Start the lab as above
- Click AWS Details (next to "End Lab")
- Click Show next to AWS CLI
- Note the three values — you will need these for GitHub Secrets or any CLI configuration:
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKEN
These credentials expire when the lab session ends. You must retrieve new ones each session.
EC2 — Elastic Compute Cloud
EC2 provides virtual servers (called instances) in the cloud. You use them to run operating systems, host web applications, and run services.
Launching an EC2 Instance
- In the AWS Console, go to Services → Compute → EC2
- Click the orange Launch Instance button
- Configure the following settings:
| Setting | Value |
|---|---|
| Name | DevOps Server (or your chosen name) |
| Amazon Machine Image (AMI) | Red Hat Enterprise Linux 9 — Free tier eligible |
| Architecture | 64-bit (x86) |
| Instance Type | t3.medium (2 vCPUs, 4GB RAM) — use t2.micro for free tier |
| Key Pair | Create a new key pair (see below) |
| Network Settings | Create a security group; check "Allow SSH traffic from Anywhere" |
| Storage | 1x 10 GiB gp3 Root volume |
| Number of Instances | 1 |
- Click Launch Instance
An instance at t2.micro qualifies for the AWS free tier. t3.medium is required for running a database (MySQL) alongside other services.
Creating a Key Pair
This key pair is what allows you to SSH into your instance. Treat it like a password — if you lose it, you cannot access the instance.
- In the key pair step during launch, click Create new key pair
- Name it (e.g.,
Western-Student) - Key pair type: RSA
- Private key format:
.ppkfor PuTTY on Windows;.pemfor Mac/Linux terminal - Click Create key pair — the file downloads automatically
- Save the file somewhere safe and back it up
Finding Your Instance's Public Address
- Go to EC2 → Instances
- Click on your instance ID
- Copy the Public IPv4 DNS — it looks like
ec2-XX-XX-XX-XX.compute-1.amazonaws.com
This address changes every time the instance is stopped and restarted.
Connecting to Your Instance via Browser Console
- In EC2, select your instance
- Click Connect at the top
- On the Connect page, click Connect at the bottom
- A Linux terminal opens in your browser
Starting, Stopping, and Changing Instance Type
- Select your instance in the EC2 dashboard
- Click Instance state at the top
- To stop: select Stop instance → Stop
- Once stopped, click Actions → Instance settings → Change instance type
- Type the new instance type (e.g.,
t3.medium) and click Change - Click Instance state → Start instance
Installing and Running a Web Server (Apache) on EC2
sudo yum install httpd # Install Apache (use yum on Amazon Linux)
sudo systemctl start httpd # Start the service
Navigate to the instance's public IP in a browser using HTTP (not HTTPS) to see the Apache default page. Make sure port 80 is open in the security group.
Installing Updates on Your Instance
sudo dnf -y update
Run this immediately after connecting to a new instance to apply all security and software updates.
Security Groups
Security groups act as virtual firewalls, controlling what traffic can reach your EC2 instances. Rules are additive — there is no explicit deny; anything not listed is blocked by default.
Opening the Security Group Editor
- Go to EC2 Dashboard
- In the Resources section at the top, click Security groups
- Click the security group ID associated with your instance (usually
launch-wizard-1)
Adding Inbound Rules
- Under Inbound rules, click Edit inbound rules
- Click Add rule
- Select the Type (e.g., SSH, HTTP, All traffic, All ICMP – IPv4)
- Select the Source (e.g., Anywhere-IPv4, My IP, Custom)
- Click Save rules
Common rule configurations:
| Purpose | Type | Port | Source |
|---|---|---|---|
| SSH access | SSH | 22 | Anywhere-IPv4 (or My IP for more security) |
| Web server | HTTP | 80 | Anywhere-IPv4 |
| Docker documentation service | Custom TCP | 8081 | Anywhere-IPv4 |
| Docker Joomla/CMS | Custom TCP | 8090 | Anywhere-IPv4 |
| Allow all (lab/dev only) | All traffic | All | Anywhere-IPv4 |
| Ping (ICMP) | All ICMP – IPv4 | N/A | Anywhere-IPv4 |
Opening "All traffic from Anywhere" is acceptable in a lab environment but should never be used in production. Tighten rules to only the ports you actually serve.
Restricting Access by IP
- Edit inbound rules for SSH
- Change Source from Anywhere-IPv4 to My IP
- AWS auto-fills your current public IP
This limits SSH access to only your current IP address. If your IP changes (e.g., switching networks), you will need to update this rule.
S3 — Simple Storage Service
S3 stores files (called objects) in containers called buckets. It is commonly used for backups, static website hosting, and serving images or assets to web applications.
Creating an S3 Bucket
- Go to Services → Storage → S3 (or search "S3")
- Click Create bucket
- Enter a globally unique bucket name (e.g.,
my-cicd-bucket-yourusername) - Under Block Public Access Settings, uncheck Block all public access if you need public access
- Check the acknowledgment box that appears
- Scroll down and click Create bucket
Bucket names must be globally unique across all of AWS. Include your username to ensure uniqueness.
Setting a Bucket Policy for Public Read Access
- Click on your bucket name
- Select the Permissions tab
- Scroll to Bucket policy and click Edit
- Paste the following, replacing
YOUR_BUCKET_NAME:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::YOUR_BUCKET_NAME/*"
}
]
}
- Click Save changes
This allows anyone on the internet to read files from your bucket. Required for static website hosting and serving images to your documentation.
Uploading Files
- Click on your bucket name
- Select the Objects tab
- Click Upload → Add files
- Select the files from your local machine
- Scroll down and click Upload
- Click Close
Getting a File's Public URL
- Click on the uploaded file under Objects
- Click Copy URL
- Test in a private/incognito browser window to confirm public access
The URL format is: https://bucket-name.s3.region.amazonaws.com/filename
Referencing an S3 Image in Markdown

Enabling Static Website Hosting
- Click your bucket name → Properties tab
- Scroll to Static website hosting → click Edit
- Select Enable
- Set Index document to
index.html - Click Save changes
- Scroll back down to copy the Bucket website endpoint URL
The website endpoint URL (http) is different from the object URL (https). Use the website endpoint when linking to the site as a whole.
Enabling Bucket Versioning
- Click your bucket name → Properties tab
- Click Edit next to Bucket Versioning
- Select Enable
- Click Save changes
Versioning saves every uploaded version of a file. You can restore previous versions from the object's Versions tab.
Configuring a Lifecycle Rule (Automatic Archiving)
- Click your bucket name → Management tab
- Click Create lifecycle rule
- Name the rule and select the scope
- Add a transition action: move to Glacier after 30 days
- Optionally add an expiration action: delete after 90 days
- Click Save
IAM — Identity and Access Management
IAM controls who can access what in your AWS account. You create users, groups, roles, and attach policies to define permissions.
Creating an IAM User
- Go to Services → Security → IAM (or search "IAM")
- Click Users → Add User
- Set a username
- Select Console access
- Set a custom password; uncheck "Users must create a new password at next sign-in"
- Click Next
- Under Set permissions, select Attach policies directly
- Search for and select a policy (e.g.,
AmazonS3FullAccess) - Click Next → Create user
In the AWS Academy Learner Lab, user creation is blocked by the lab environment. The steps above reflect real-world usage.
Common Predefined Policies
| Policy | Access Granted |
|---|---|
AmazonS3FullAccess |
Full read/write access to all S3 buckets |
AmazonEC2FullAccess |
Full control over all EC2 instances and resources |
AdministratorAccess |
Full access to all AWS services — use sparingly |
ReadOnlyAccess |
Read-only access to all services |
CloudWatch — Monitoring and Alarms
CloudWatch collects performance metrics from your AWS resources and can trigger alarms when thresholds are exceeded.
Setting a CPU Utilization Alarm
- Search for CloudWatch in the AWS console
- In the left menu, click Alarms → All alarms
- Click Create alarm
- Click Select metric → EC2 → Per-Instance Metrics
- Find your instance ID and select CPUUtilization
- Click Select metric
- Set the threshold: Greater than 70% over 1 evaluation period
- Configure notifications if desired
- Name the alarm and click Create alarm
Generating CPU Load to Test an Alarm
sudo amazon-linux-extras enable epel # Enable extra package repositories
sudo yum install -y epel-release # Install the EPEL repository
sudo yum install -y stress # Install the stress testing tool
sudo stress --cpu 1 --timeout 120 # Run a 1-core CPU stress test for 120 seconds
After running this, navigate to CloudWatch and watch the alarm state change from OK to ALARM.
Billing Alerts (Real-World — Not Available in Learner Lab)
- Go to Services → Cloud Financial Management → Billing and Cost Management
- On the left menu, click Budgets
- Click Create budget
- Accept the defaults: Use a template → Zero spend budget
- Enter your email under Email recipients
- Click Create budget
This sends an email notification immediately when any billable charge occurs. Essential for avoiding unexpected costs.
GitHub Actions Secrets for AWS Deployment
After retrieving your credentials from AWS Details, add them to your GitHub repository:
- In your GitHub repo, go to Settings → Secrets and variables → Actions
- Click New repository secret for each of the following:
| Secret Name | Value |
|---|---|
AWS_ACCESS_KEY_ID |
From AWS Details → AWS CLI |
AWS_SECRET_ACCESS_KEY |
From AWS Details → AWS CLI |
AWS_SESSION_TOKEN |
From AWS Details → AWS CLI |
AWS_REGION |
us-east-1 |
S3_BUCKET_NAME |
Your bucket name (e.g., my-cicd-bucket-yourusername) |
EC2_SSH_KEY |
Full contents of your .pem private key file |
EC2_HOST |
Your EC2 instance's Public IPv4 DNS |
Secrets are encrypted and never visible after being saved. If you need to update a value, you must overwrite it by creating a new secret with the same name.