This project provides a comprehensive solution for monitoring cost anomalies across multiple cloud providers: Amazon Web Services (AWS), Azure, and Google Cloud Platform (GCP). It utilizes Terraform to set up the necessary resources and configurations for effective cost monitoring and alerting.
The project is organized into the following directories:
-
aws/: Contains Terraform configurations specific to AWS cost anomaly monitoring.
-
main.tf
: AWS cost monitoring resources. -
example.auto.tfvars
: Example input variables for AWS module. -
variables.tf
: Input variables for AWS setup. -
outputs.tf
: Outputs from AWS resources. -
providers.tf
: configures AWS Terraform provider -
versions.tf
: specifies the Terraform version and required providers
-
-
azure/: Contains Terraform configurations specific to Azure cost anomaly monitoring.
main.tf
: Azure cost monitoring resources.example.auto.tfvars
: Example input variables for Azure module.variables.tf
: Input variables for Azure setup.outputs.tf
: Outputs from Azure resources.providers.tf
: configures Azure Terraform providerversions.tf
: specifies the Terraform version and required providers
-
gcp/: Contains Terraform configurations specific to GCP cost anomaly monitoring.
main.tf
: GCP cost monitoring resources.example.auto.tfvars
: Example input variables for GCP module.variables.tf
: Input variables for GCP setup.outputs.tf
: Outputs from GCP resources.providers.tf
: configures Google Cloud Terraform providerversions.tf
: specifies the Terraform version and required providers
-
modules/: Contains reusable modules for cost monitoring across different cloud providers.
- aws-cost-monitoring/: AWS cost monitoring module.
main.tf
: Reusable configuration for AWS.variables.tf
: Input variables for AWS module.outputs.tf
: Outputs from AWS module.
- azure-cost-monitoring/: Azure cost monitoring module.
main.tf
: Reusable configuration for Azure.variables.tf
: Input variables for Azure module.outputs.tf
: Outputs from Azure module.
- gcp-cost-monitoring/: GCP cost monitoring module.
main.tf
: Reusable configuration for GCP.variables.tf
: Input variables for GCP module.outputs.tf
: Outputs from GCP module.
- aws-cost-monitoring/: AWS cost monitoring module.
-
Prerequisites: Ensure you have Terraform installed on your machine. You will also need access credentials for AWS, Azure, and GCP.
- AWS CLI: Install AWS CLI
- Azure 'az' CLI: Install Azure CLI
- GCP 'gcloud' CLI`: Install GCP SDK
- Terraform: Install Terraform or OpenToFuInstall OpenToFu
-
Configure Variables
- Update the variables in
tfvars
files in theaws/
,azure/
, andgcp/
directories to specify your variables such as customizing thresholds and specifying notification email addresses.
- Update the variables in
-
Initialize Terraform: Navigate to the root of the project and run:
terraform init
-
Plan the Deployment: Run the following command to see the resources that will be created:
terraform plan
-
Apply the Configuration: Deploy the resources by running:
terraform apply
After deployment, the project will monitor cost anomalies across the specified cloud providers. You can reference the outputs defined in the outputs.tf
files to get insights into the monitoring setup.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.