Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_budgets_budget.limit_amount not settling due to differences in decimal places #10692

Closed
software-opal opened this issue Oct 31, 2019 · 6 comments · Fixed by #9092
Closed
Labels
bug Addresses a defect in current functionality. service/budgets Issues and PRs that pertain to the budgets service.
Milestone

Comments

@software-opal
Copy link

software-opal commented Oct 31, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

$ terraform -v
Terraform v0.12.12
+ provider.aws v2.33.0
+ provider.http v1.1.1
+ provider.kubernetes v1.9.0
+ provider.local v1.4.0
+ provider.null v2.1.2
+ provider.random v2.2.1
+ provider.template v2.1.2

Affected Resource(s)

  • aws_budgets_budget

Terraform Configuration Files

resource "aws_budgets_budget" "budget" {
  name              = "Monthly Budget"
  budget_type       = "COST"
  time_period_start = "2019-09-01_00:00"
  time_unit         = "MONTHLY"
  limit_amount = 2000
  limit_unit   = "USD"

  cost_types {
    include_credit = false
    include_refund = false
  }

  notification {
    comparison_operator = "GREATER_THAN"
    threshold           = "100"
    threshold_type      = "PERCENTAGE"
    notification_type   = "ACTUAL"

    subscriber_email_addresses = [
      "ops@example.com",
    ]
  }
}

Output


An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # aws_budgets_budget.budget will be updated in-place
  ~ resource "aws_budgets_budget" "budget" {
        account_id        = "608019992430"
        budget_type       = "COST"
        cost_filters      = {}
        id                = "608019992430:Monthly Budget"
      ~ limit_amount      = "2000.0" -> "2000"
        limit_unit        = "USD"
        name              = "Monthly Budget"

... snip ...

aws_budgets_budget.budget: Modifying... [id=608019992430:Monthly Budget]
2019/10/31 02:16:09 [WARN] Provider "aws" produced an unexpected new value for aws_budgets_budget.budget, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .limit_amount: was cty.StringVal("2000"), but now cty.StringVal("2000.0")
2019/10/31 02:16:09 [TRACE] <root>: eval: *terraform.EvalMaybeTainted
2019/10/31 02:16:09 [TRACE] <root>: eval: *terraform.EvalWriteState
2019/10/31 02:16:09 [TRACE] EvalWriteState: writing current state object for aws_budgets_budget.budget
aws_budgets_budget.budget: Modifications complete after 5s [id=608019992430:Monthly Budget]

Expected Behavior

Applying the budget, then applying again should result in no changes

Actual Behavior

Budget will not settle

Steps to Reproduce

  1. terraform apply

Important Factoids

N/A

References

Work around

In my real terraform file I am loading the budget from a variable; so changing

  limit_amount = var.my_budget

to

  limit_amount = format("%.1f", var.my_budget)

allows the resource to settle.

@ghost ghost added the service/budgets Issues and PRs that pertain to the budgets service. label Oct 31, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 31, 2019
@ryndaniels ryndaniels added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Nov 4, 2019
@ChernikovP
Copy link

ChernikovP commented Mar 5, 2020

This is still valid issue for provider.aws v2.51.0.

@nicwise
Copy link
Contributor

nicwise commented May 10, 2020

Still valid in 2.61

@nicois
Copy link

nicois commented Jun 11, 2020

it's great to have a workaround, but it can't be that complicated to fix can it?

@pedrocunha
Copy link

This one was a big headache. For TF 0.11 had to do 🤯 :

"${format("%.2f", local.my_var+0.0)}"

@github-actions
Copy link

This functionality has been released in v3.52.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/budgets Issues and PRs that pertain to the budgets service.
Projects
None yet
6 participants