📖 Scenario: You are working as a cloud engineer for a small company that wants to improve its AWS environment's operational excellence. Your task is to create a simple AWS CloudFormation template that sets up basic monitoring and alerting to help the company detect and respond to issues quickly.
🎯 Goal: Build a CloudFormation template that defines a CloudWatch Alarm monitoring CPU utilization of an EC2 instance and a SNS Topic for alert notifications. This setup helps the company follow the AWS Operational Excellence pillar by improving monitoring and incident response.
📋 What You'll Learn
Create a CloudFormation template with an EC2 instance resource.
Add a CloudWatch Alarm that triggers when CPU utilization exceeds 70%.
Create an SNS Topic for alarm notifications.
Subscribe an email endpoint to the SNS Topic.
💡 Why This Matters
🌍 Real World
Monitoring and alerting are essential for running reliable cloud applications. This project shows how to set up basic monitoring and notifications in AWS to detect and respond to issues quickly.
💼 Career
Cloud engineers and DevOps professionals use CloudFormation templates to automate infrastructure setup. Understanding how to implement monitoring and alerting aligns with operational excellence best practices required in many cloud roles.
Progress0 / 4 steps
1
Create the EC2 Instance Resource
Create a CloudFormation template with a resource named MyEC2Instance of type AWS::EC2::Instance. Set the ImageId property to ami-0abcdef1234567890 and InstanceType to t2.micro.
AWS
Hint
Use the Resources section to define the EC2 instance with the exact name and properties.
2
Add SNS Topic for Notifications
Add a resource named AlarmNotificationTopic of type AWS::SNS::Topic to the CloudFormation template.
AWS
Hint
Define the SNS Topic resource under Resources with the exact name AlarmNotificationTopic.
3
Create CloudWatch Alarm for CPU Utilization
Add a resource named HighCPUAlarm of type AWS::CloudWatch::Alarm. Configure it to monitor the CPUUtilization metric of the EC2 instance MyEC2Instance. Set the alarm to trigger when CPU utilization is greater than 70% for 5 minutes (evaluation periods 1, period 300 seconds). Set the AlarmActions to notify the AlarmNotificationTopic.
AWS
Hint
Use Dimensions with InstanceId set to !Ref MyEC2Instance to link the alarm to the EC2 instance.
4
Subscribe Email Endpoint to SNS Topic
Add a resource named EmailSubscription of type AWS::SNS::Subscription. Set the Protocol to email, the Endpoint to alerts@example.com, and the TopicArn to reference AlarmNotificationTopic.
AWS
Hint
Use the AWS::SNS::Subscription resource type with the exact properties to subscribe the email.
Practice
(1/5)
1. What is the main goal of the Operational Excellence pillar in AWS Well-Architected Framework?
easy
A. To optimize costs and reduce spending
B. To secure data and control access to resources
C. To improve and automate processes for better system reliability and efficiency
D. To design systems for high availability and fault tolerance
Solution
Step 1: Understand the focus of Operational Excellence
Operational Excellence focuses on running and monitoring systems to deliver business value and continually improve processes.
Step 2: Differentiate from other pillars
Security focuses on protection, Cost Optimization on spending, Reliability on availability. Operational Excellence is about process improvement and automation.
Final Answer:
To improve and automate processes for better system reliability and efficiency -> Option C
Quick Check:
Operational Excellence = process improvement and automation [OK]
Enable detailed CloudWatch Logs and set up alarms on error metrics -> Option B
Quick Check:
Monitoring + alarms = better debugging [OK]
Hint: Use logs and alarms to find and fix errors [OK]
Common Mistakes:
Turning off logs to 'speed up' functions
Ignoring automated monitoring tools
Relying on manual fixes instead of automation
5. A company wants to improve operational excellence by automating incident response for their EC2 fleet. Which combination of AWS services best achieves this?
hard
A. Amazon RDS + Amazon DynamoDB + AWS Elastic Beanstalk
B. Amazon S3 + AWS Glue + Amazon Athena
C. AWS IAM + AWS KMS + AWS Shield
D. AWS Systems Manager Automation + Amazon CloudWatch Events + AWS Lambda
Solution
Step 1: Identify services for automation and event-driven response