{"id":21726462,"url":"https://github.com/notharshhaa/aws-billing-alert-terraform","last_synced_at":"2025-04-09T16:05:09.048Z","repository":{"id":254379129,"uuid":"688314953","full_name":"NotHarshhaa/aws-billing-alert-terraform","owner":"NotHarshhaa","description":"𝐓𝐡𝐢𝐬 𝐫𝐞𝐩𝐨𝐬𝐢𝐭𝐨𝐫𝐲 𝐜𝐨𝐧𝐭𝐚𝐢𝐧𝐬 𝐚 𝐓𝐞𝐫𝐫𝐚𝐟𝐨𝐫𝐦 𝐦𝐨𝐝𝐮𝐥𝐞 𝐭𝐡𝐚𝐭 𝐡𝐞𝐥𝐩𝐬 𝐬𝐞𝐭 𝐮𝐩 𝐀𝐖𝐒 𝐛𝐢𝐥𝐥𝐢𝐧𝐠 𝐚𝐥𝐞𝐫𝐭𝐬","archived":false,"fork":false,"pushed_at":"2025-03-07T06:04:48.000Z","size":21,"stargazers_count":46,"open_issues_count":0,"forks_count":45,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T16:05:02.126Z","etag":null,"topics":["aws","aws-billing","aws-terraform","terraform","terraform-modules"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NotHarshhaa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-07T05:17:11.000Z","updated_at":"2025-03-24T12:21:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"3e0b9882-e525-4251-ac81-e1aa1295e08e","html_url":"https://github.com/NotHarshhaa/aws-billing-alert-terraform","commit_stats":null,"previous_names":["notharshhaa/aws-billing-alert-terraform"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotHarshhaa%2Faws-billing-alert-terraform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotHarshhaa%2Faws-billing-alert-terraform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotHarshhaa%2Faws-billing-alert-terraform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotHarshhaa%2Faws-billing-alert-terraform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NotHarshhaa","download_url":"https://codeload.github.com/NotHarshhaa/aws-billing-alert-terraform/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065289,"owners_count":21041871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-billing","aws-terraform","terraform","terraform-modules"],"created_at":"2024-11-26T03:36:02.610Z","updated_at":"2025-04-09T16:05:09.029Z","avatar_url":"https://github.com/NotHarshhaa.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 AWS Billing Alert Terraform Module  \n\n![AWS-billing](https://imgur.com/wtaBi16.png)  \n\nWelcome to the **AWS Billing Alert Terraform module!** This module helps you set up automatic billing alerts for your AWS account. Once configured, you'll receive notifications when your AWS charges exceed specified amounts, helping you stay on top of your costs. 💰  \n\n---\n\n## 🛠️ Prerequisites  \n\n\u003e [!IMPORTANT]\n\u003e **Before you begin, make sure you have the following:**  \n\u003e\n\u003e - 🧰 **Terraform (v1.5.0 or later)** installed on your local machine.  \n\u003e - 🌐 **An AWS account** with appropriate permissions.  \n\u003e - 🔑 **AWS CLI** configured with the necessary credentials.  \n\n---\n\n## 🔍 Understanding the AWS Services  \n\n### 🌟 AWS CloudWatch  \n\n[AWS CloudWatch](https://aws.amazon.com/cloudwatch/) is a monitoring and observability service that collects and tracks metrics, collects and monitors log files, and sets alarms. This module uses CloudWatch to monitor your AWS billing and trigger an alarm when specified thresholds are exceeded.  \n\n### 📢 AWS SNS (Simple Notification Service)  \n\n[AWS SNS](https://aws.amazon.com/sns/) is a fully managed messaging service. It allows you to send notifications to multiple subscribers. In this module, SNS is used to send billing alerts via email, SMS, or other supported channels when the CloudWatch alarm is triggered.  \n\n### 🧾 AWS Billing  \n\n[AWS Billing](https://aws.amazon.com/aws-cost-management/aws-bill/) provides tools to manage your AWS costs and budget. This module automates the monitoring of your AWS billing, so you're notified before your bill goes beyond your expectations.  \n\n---\n\n## 🚀 New Features \u0026 Improvements [07-03-2025]\n\n✅ **Multiple Email Alerts** – Supports multiple recipients by allowing a list of emails.  \n✅ **SNS Dead-Letter Queue (DLQ)** – Ensures failed notifications are retried.  \n✅ **Per-Service Billing Alerts** – Monitors spending on individual AWS services like EC2, S3, etc.  \n✅ **Enhanced CloudWatch Filters** – Improved billing log monitoring for better cost visibility.  \n✅ **CloudWatch Dashboard** – Provides an overview of billing trends and cost insights.  \n\n---\n\n## 📦 Setup Instructions  \n\n### 1️⃣ Clone the Repository  \n\n1. Open your terminal or command prompt.  \n2. Navigate to the directory where you'd like to place the project:  \n\n   ```bash  \n   cd /path/to/your/directory  \n   ```  \n\n3. Clone the repository:  \n\n   ```bash  \n   git clone https://github.com/NotHarshhaa/aws-billing-alert-terraform.git  \n   ```  \n\n4. Move into the directory:  \n\n   ```bash  \n   cd aws-billing-alert-terraform  \n   ```  \n\n---\n\n### 2️⃣ Install Terraform  \n\nFollow the steps in your system documentation to install **Terraform** or use the quick instructions for Amazon Linux:  \n\n```bash  \nsudo yum install -y yum-utils shadow-utils  \nsudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/AmazonLinux/hashicorp.repo  \nsudo yum -y install terraform  \nterraform --version  \n```  \n\n---\n\n### 3️⃣ Initialize Terraform  \n\nPrepare Terraform for use:  \n\n```bash  \nterraform init  \n```  \n\n---\n\n### 4️⃣ Configure and Apply Changes  \n\n#### Update Configuration Variables:  \n\nWith the recent changes, you can now: \n\n- Set custom **AWS regions** using `aws_region`.  \n- Configure **currencies** for billing alerts.  \n- Automatically confirm **email subscriptions** for ease of setup during testing.  \n- Configure **per-service billing alerts** to track costs for specific AWS services.  \n- Enable **SNS DLQ** for better message reliability.  \n- Visualize billing trends via the **CloudWatch Dashboard**.  \n\nUpdate the `terraform.tfvars` file with your settings:  \n\n```hcl  \naws_region            = \"us-east-1\"  \nalert_thresholds      = [100, 150, 200]  \ncurrency              = \"USD\"  \nemail_endpoints       = [\"your-email@example.com\", \"team@example.com\"]  \nauto_confirm_subscription = true  \n```  \n\n#### Apply the Configuration:  \n\n```bash  \nterraform apply  \n```  \n\n---\n\n## 🔧 Customization  \n\n### Billing Thresholds  \n\nModify the `alert_thresholds` in your variables file to configure additional thresholds for your billing alerts:  \n\n```hcl  \nalert_thresholds = [100, 150, 200, 250]  \n```  \n\n### Email Subscription Auto-Confirmation  \n\nFor testing purposes, you can enable automatic email confirmation by setting:  \n\n```hcl  \nauto_confirm_subscription = true  \n```  \n\n\u003e [!IMPORTANT]  \n\u003e **Use this option only in test environments with proper permissions.**  \n\n---\n\n## 📬 Notifications  \n\nThis module supports email alerts via **AWS SNS**. Update the `email_endpoints` variable with your preferred email addresses to receive billing notifications.  \n\n---\n\n## 📝 Example Usage  \n\nHere’s an example configuration:  \n\n```hcl  \nmodule \"billing_alert\" {  \n  source                     = \"github.com/NotHarshhaa/aws-billing-alert-terraform\"  \n  aws_region                 = \"us-west-2\"  \n  alert_thresholds           = [100, 150, 200]  \n  email_endpoints            = [\"my-email@example.com\", \"finance@example.com\"]  \n  auto_confirm_subscription  = true  \n  currency                   = \"USD\"  \n}  \n```  \n\n---\n\n## 🎯 Usage  \n\nThis module is flexible and supports dynamic region, currency, and threshold configurations. Customize the `alert.tf` file as needed and reapply the configuration using `terraform apply`.  \n\n---\n\n## 🙌 Feedback and Contributions\n\n\u003e [!TIP]  \n\u003e _We'd love to hear your thoughts! Whether it's feedback, bug reports, or pull requests, feel free to get involved. Your contributions help make this module better for everyone._\n\n## ⭐ Hit the Star  \n\n\u003e [!IMPORTANT]  \n\u003e _If you find this repository helpful for learning or in practice, **please hit the star button on GitHub.** ⭐ It helps others find this resource too!_\n\n### 👤 Author  \n\n![banner](https://imgur.com/2j7GSPs.png)\n\n\u003e [!TIP]  \n\u003e **Join Our [Telegram Community](https://t.me/prodevopsguy) || [Follow me on GitHub](https://github.com/NotHarshhaa) for more DevOps content!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotharshhaa%2Faws-billing-alert-terraform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotharshhaa%2Faws-billing-alert-terraform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotharshhaa%2Faws-billing-alert-terraform/lists"}