This project deploys a serverless health-monitoring system on AWS using Terraform. It leverages an AWS Lambda function, triggered every 5 minutes by Amazon EventBridge (CloudWatch Events), to perform an HTTP health check on a specified URL.
Notifications regarding the website's status are sent via an Amazon SNS Topic. Execution results are persisted in an Amazon DynamoDB table, which are then retrieved by a secondary Lambda function to generate a status report hosted in an Amazon S3 bucket.
- EventBridge: Triggers the "Checker" Lambda function on a 5-minute schedule.
- Lambda (Checker): Executes an HTTP request and evaluates the response.
- SNS: Dispatches alerts if the health check fails or the site is unreachable.
- DynamoDB: Stores historical check data (status codes, timestamps, and latency).
- Lambda (Reporter): Queries DynamoDB to aggregate uptime data.
- S3 Bucket: Hosts the final output for visualization.
Terraform Cloud requires specific variables to manage your infrastructure.
- Navigate to your workspace:
website_check_serverless. - Go to the Variables tab.
- Add the following under the Terraform variables section:
| Variable | Description | Example |
|---|---|---|
aws_region |
The AWS region to deploy resources. | eu-west-1 |
target_url |
The URL you want to monitor. | https://example.com |
email_endpoint |
Email address for alert notifications. | devops@example.com |
Open your terminal in the project root and run the initialization command. This will connect to Terraform Cloud and download the necessary AWS providers.
terraform initterraform plan
terraform apply -auto-approve

