Terraform v0.10.3
related to https://github.com/hashicorp/terraform/issues/494.
basically trying to generate a timestamp, but the default format doesn't work. currently using variable and the date command on the cli to get around this.
terraform apply -var=timestamp=$(date '+%Y-%m-%d.%s')
thinking something along the lines of the random provider but for time would be grand.
it would:
1) regenerate a timestamp each time the keeper changes.
2) provider attributes like unix, and different common formats.
3) have a way to customize the time format explicitly.
resource "time" "default" {
keepers = {
ami_id = "keepme"
}
}
+1 for this. We put kill date tags onto resources in our AWS R&D labs to help keep things tidy, so being able to evaluate today+7 days somehow would be very nice!
Currently using the timestamp() interpolation, but what I really need is the ability to modify it (trying to create aws_autoscaling_schedule with a start time of "now").
effectively timestamp could accept an optional format modifier as a parameter, so you can do things like timestamp( "+%Y-%m-%d.%s"), and same for timeadd(time, duration, format).
Hi folks 👋 As a side project, I have experimentally created the following: https://github.com/bflad/terraform-provider-time
It supports a few things in the initial release of a time_static resource:
The former should cover some of the cases above when combined with the formatdate() function and the timeadd() function. The latter seems like it could unlock some interesting use cases, such as potentially triggering workflows on a cadence.
Please give it a shot! I have not experimented with it in real world configurations yet (beyond acceptance testing just the resource itself), so please be mindful that there could be some very rough edges initially, especially with the expiration rotation.
This experimental provider (v0.2.0) now supports three separate resources:
time_offset Resource: For saving an offset timetime_rotating Resource: For triggering recreation on a cadencetime_static Resource: For saving a static timeHope this helps. 🚀
Hi again 👋 The Terraform Time Provider is now available for usage via terraform init. For any future feature requests or bug reports with that functionality, please open a GitHub issue in its dedicated issue tracker. 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.
Most helpful comment
+1 for this. We put kill date tags onto resources in our AWS R&D labs to help keep things tidy, so being able to evaluate
today+7 dayssomehow would be very nice!