Open juicybaba opened 1 year ago
Thanks for raising this issue. Seems service API always returns the format "2023-08-01T00:00:00Z". Hopes below example is helpful.
end_date = format("%s-01-01T23:59:59Z", local.current_year)
Thanks for raising this issue. Seems service API always returns the format "2023-08-01T00:00:00Z". Hopes below example is helpful.
end_date = format("%s-01-01T23:59:59Z", local.current_year)
@neil-yechenwei Thanks for the reply. The problem is that in next run(without changing any code) terraform will revert the format back to the format in the code and this will trigger a force replacement of the resource.
I suggest using lifecycle and ignoring the time_perior property (then you wouldn't need to care about any changes. In case of updates you can instead tie the resource lifecycle to the change in the variable I believe, so that the explicit variable change rebuils the whole budget perhaps and not the property change).
In case of dynamically calculated budgets (aka normal IaC code) TF will send a new date on every deployment and the API re-deploys the budget, so you automatically "resolve" 1 more additional issue.
I suggest using lifecycle and ignoring the time_perior property (then you wouldn't need to care about any changes. In case of updates you can instead tie the resource lifecycle to the change in the variable I believe, so that the explicit variable change rebuils the whole budget perhaps and not the property change).
In case of dynamically calculated budgets (aka normal IaC code) TF will send a new date on every deployment and the API re-deploys the budget, so you automatically "resolve" 1 more additional issue.
yea, thanks, this is what i am doing
Is there an existing issue for this?
Community Note
Terraform Version
1.5.4
AzureRM Provider Version
3.69.0
Affected Resource(s)/Data Source(s)
azurerm_consumption_budget_management_group and azurerm_consumption_budget_subscription
Terraform Configuration Files
Expected Behaviour
no change should be detected in next run
Actual Behaviour
It looks like time got configured in a different format than what I provided, or I will say the format that
azurerm
provider accepts.I got the below error when using the format from the above screenshot
If this is something that needs to be fixed from the provider side, double-check all
azurerm_consumption_budget_*
resources.Steps to Reproduce
No response
Important Factoids
No response
References
No response