-
Notifications
You must be signed in to change notification settings - Fork 31
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
time_rotating constantly re-creates resource after rfc3339 + rotation_xy has passed the first time. #44
Comments
Can someone confirm this issue? Is this a bug or a lack of documentation? It does work as expected without the |
I'm experiencing this issue too. My assumption was that the rfc3339 argument was setting the initial time for calculating the rotation time, after which the rotation_X argument would become the increment and the resource would be recreated every N rotation_X's time. I can't see how the actual behaviour is useful. |
This really needs to be fixed. I think what needs to happen is that the provider should compare the id to rotation_rfc3339 and not rotate if it's past it. |
At the moment the time_rotating doesn't work like a clock. The rotation_rfc3339 calculation is too simple and with a fixed rfc3339 ends up constantly in the past, resulting in the Delete -> create identically on every Apply to infinity. Why not have some clock arithmetic, it could be a switch like To illustrate what we want, I think, if rfc3339 input is not null,
if rfc3339 input in the future, we want this:
So could it be coded like this?
|
Why has this issue has not been fixed since Jun 28, 2021? How else can one create a rotating timestamp starting say 15 days from now to rotate every 30 days? rfc3339 should be the base timestamp. It should only be used to start the rotation from. |
BTW, I also ran into this bug... The workaround requires that the Example command to obtain timestamps:
Example import command 12 hours in the future w/ daily rotation:
Looks like #180 would resolve this issue. |
Hi @m273d15 thanks for raising this issue, |
I think another workaround is to only set
Unfortunately |
Just commenting to say I found this after encountering the same issue those have described above - this resource is pointless if it doesn't maintain a constantly rotating time. At the moment, after the rotation period has elapsed the resource behaves like |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Output
Panic Output
Expected Behavior
terraform apply
and not created again before the date rfc3339 + rotation_minutes (in the example above:2021-06-20T12:50:13Z
) has passed.terraform apply
will re-create the resource. If I callterraform apply
again the resource should not be re-created as long as the current date is lower than the next rotation date (would be rfc3339 + rotation_minutes * 2)short:
...
Actual Behavior
terraform apply
and not created again before the date rfc3339 + rotation_minutes (in the example above:2021-06-20T12:50:13Z
) has passed.terraform apply
leads to the re-creation of the resource.short:
...
Steps to Reproduce
With the example above it should be enough to call:
terraform init
terraform apply
- initial creationterraform apply
- re-creationImportant Factoids
References
Thank you for your work on Terraform ❤️
The text was updated successfully, but these errors were encountered: