<!-- BEGIN_TF_DOCS -->
[![Geek Cell GmbH](https://raw.githubusercontent.com/geekcell/.github/main/geekcell-github-banner.png)](https://www.geekcell.io/)

### Code Quality
[![License](https://img.shields.io/github/license/geekcell/terraform-aws-budgets)](https://github.com/geekcell/terraform-aws-budgets/blob/master/LICENSE)
[![GitHub release (latest tag)](https://img.shields.io/github/v/release/geekcell/terraform-aws-budgets?logo=github&sort=semver)](https://github.com/geekcell/terraform-aws-budgets/releases)
[![Release](https://github.com/geekcell/terraform-aws-budgets/actions/workflows/release.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-budgets/actions/workflows/release.yaml)
[![Validate](https://github.com/geekcell/terraform-aws-budgets/actions/workflows/validate.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-budgets/actions/workflows/validate.yaml)
[![Lint](https://github.com/geekcell/terraform-aws-budgets/actions/workflows/linter.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-budgets/actions/workflows/linter.yaml)

<!--

Comment in once Bridgecrew has been configured

### Security
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/general)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=INFRASTRUCTURE+SECURITY)

#### Cloud
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/cis_aws)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=CIS+AWS+V1.2)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/cis_aws_13)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=CIS+AWS+V1.3)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/cis_azure)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=CIS+AZURE+V1.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/cis_azure_13)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=CIS+AZURE+V1.3)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/cis_gcp)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=CIS+GCP+V1.1)

##### Container
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/cis_kubernetes_16)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=CIS+KUBERNETES+V1.6)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/cis_eks_11)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=CIS+EKS+V1.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/cis_gke_11)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=CIS+GKE+V1.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/cis_kubernetes)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=CIS+KUBERNETES+V1.5)

#### Data protection
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/soc2)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=SOC2)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/pci)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=PCI-DSS+V3.2)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/pci_dss_v321)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=PCI-DSS+V3.2.1)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/iso)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=ISO27001)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/nist)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=NIST-800-53)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/hipaa)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=HIPAA)
[![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/geekcell/terraform-aws-budgets/fedramp_moderate)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=geekcell%2Fterraform-aws-budgets&benchmark=FEDRAMP+%28MODERATE%29)

-->

# Terraform AWS Budgets

This Terraform module provides a preconfigured solution for setting up
AWS Budgets for your AWS account. Our team has years of experience working
with AWS Budgets, and we are sharing our knowledge with you through this
module. With this module, you can quickly and easily set up budgets that
align with your organization's goals and get alerts when your usage exceeds
your specified limits. By using this module, you can save time and avoid
common mistakes when setting up AWS Budgets.

Not only is this module easy to configure, but it also encapsulates
everything you need in one place. You can simply use the module and be
confident that everything has been set up correctly and efficiently.

This makes it an excellent choice for organizations of any size looking
to effectively manage their AWS costs.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_budgets"></a> [budgets](#input\_budgets) | The list of budget. | <pre>list(object({<br>    name              = string<br>    budget_type       = string<br>    limit_amount      = string<br>    limit_unit        = string<br>    time_period_start = string<br>    time_period_end   = string<br>    time_unit         = string<br><br>    cost_filter = optional(map(list(string)))<br><br>    notification = object({<br>      comparison_operator = string<br>      threshold           = string<br>      threshold_type      = string<br>      notification_type   = string<br>    })<br>  }))</pre> | <pre>[<br>  {<br>    "budget_type": "COST",<br>    "limit_amount": "200",<br>    "limit_unit": "USD",<br>    "name": "budget-account-monthly",<br>    "notification": {<br>      "comparison_operator": "GREATER_THAN",<br>      "notification_type": "FORECASTED",<br>      "threshold": "100",<br>      "threshold_type": "PERCENTAGE"<br>    },<br>    "time_period_end": "2087-06-15_00:00",<br>    "time_period_start": "2023-01-01_00:00",<br>    "time_unit": "MONTHLY"<br>  }<br>]</pre> | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the budget. | `string` | n/a | yes |
| <a name="input_recipients"></a> [recipients](#input\_recipients) | The email addresses to send notifications to. | `list(string)` | n/a | yes |

## Outputs

No outputs.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.4 |

## Resources

- resource.aws_budgets_budget.main (main.tf#19)
- data source.aws_caller_identity.current (data.tf#1)

# Examples
### Basic Example
```hcl
module "basic-example" {
  source = "../../"
  name   = var.name

  recipients = var.recipients

  budgets = [
    {
      name = var.name

      budget_type  = "COST"
      limit_amount = var.amount
      limit_unit   = var.amount_unit

      time_period_start = "2023-01-01_00:00"
      time_period_end   = "2087-06-15_00:00"
      time_unit         = "MONTHLY"

      notification = {
        comparison_operator = "GREATER_THAN"
        threshold           = "80"
        threshold_type      = "PERCENTAGE"
        notification_type   = "FORECASTED"
      }
    }
  ]
}
```

### Advanced Example
```hcl
module "advanced-example" {
  source = "../../"
  name   = "my-budget"

  budgets = [
    {
      name              = "ec2-rds-monthly-in-eu-central-1"
      budget_type       = "COST"
      limit_amount      = "200"
      limit_unit        = "USD"
      time_period_start = "2023-01-01_00:00"
      time_period_end   = "2087-06-15_00:00"
      time_unit         = "MONTHLY"

      cost_filter = {
        "Service" = [
          "Amazon Elastic Compute Cloud - Compute",
          "Amazon Relational Database Service"
        ]
        "Region" = [
          "eu-central-1"
        ]
      }

      notification = {
        comparison_operator = "GREATER_THAN"
        threshold           = "80"
        threshold_type      = "PERCENTAGE"
        notification_type   = "FORECASTED"
      }
    }
  ]

  recipients = ["no-reply@example.org"]
}
```
<!-- END_TF_DOCS -->