-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
timestamp() always triggers resource replacement, even when it is interpolated #22461
Comments
Hi @eerkunt! What you're seeing here is a result of the fact that the In general we don't recommend using What you are trying to do here is a little outside of Terraform's intended use-cases, so there isn't a direct way to solve it, but there are some possible approaches you could try:
Since what you are doing here is not an intented use-case for the core Terraform workflow, we don't expect to add any new Terraform features to make it easier to achieve, and so we're going to close this. Hopefully the above give some ideas about how you might be able to use Terraform as a building block for solving your problem in conjunction with some other software. If you have any further questions, please feel free to start a new topic on the community forum. Thanks! |
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. |
Terraform Version
Terraform Configuration Files
Expected Behavior
Resource replacement every day due to
formatdate()
interpolation withYYYYMMDD
.Actual Behavior
Resource replacement on every run.
Steps to Reproduce
terraform init
terraform apply
Additional Context
I also tried the same code using
random_id
with the code example below ;same problem. Whenever
timestamp()
is used, a new resource creation is triggered.The only way I could fix this problem is to define a
date
variable and pass it via-var
on the CLI.References
Couldn't find any reference specific to this problem.
The text was updated successfully, but these errors were encountered: