Skip to content

Commit

Permalink
feat: added auto_adjust_data attribute (#29)
Browse files Browse the repository at this point in the history
* feat: added auto_adjust_data attribute

* updated readme

* removed manual in-line

* doc: update version constraint

---------

Co-authored-by: Joe Niland <[email protected]>
  • Loading branch information
mayank0202 and joe-niland authored Jan 22, 2024
1 parent c220256 commit 9e62307
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

Terraform module to create [AWS Budgets](https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html) and an associated SNS topic and Lambda function to send notifications to Slack.


---
> [!NOTE]
> This project is part of Cloud Posse's comprehensive ["SweetOps"](https://cpco.io/sweetops) approach towards DevOps.
Expand All @@ -41,9 +42,6 @@ Terraform module to create [AWS Budgets](https://docs.aws.amazon.com/cost-manage






## Usage


Expand Down
10 changes: 10 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ resource "aws_budgets_budget" "default" {
time_period_end = lookup(each.value, "time_period_end", null)
time_unit = each.value.time_unit

dynamic "auto_adjust_data" {
for_each = lookup(each.value, "auto_adjust_data", null) != null ? try(tolist(each.value.auto_adjust_data), [
each.value.auto_adjust_data
]) : []

content {
auto_adjust_type = auto_adjust_data.value.auto_adjust_type
}
}

dynamic "cost_types" {
for_each = lookup(each.value, "cost_types", null) != null ? [each.value.cost_types] : []

Expand Down

0 comments on commit 9e62307

Please sign in to comment.