hashicorp/terraform-provider-random

Feature Request: Random Date

Closed this issue · 2 comments

It would be nice to have a resource that generates a random date in a given format.

For instance:

resource "random_date" "example" {
  start_date = "2023-01-01"
  end_date   = "2023-12-31"

  format     = "YYYY-MM-DD"
}

output "random_generated_date" {
  value = random_date.example.result
}

I'm would love to contribute this new resource if it aligns with the vision of this provider and is something we intend to support. :)

I'm copying my response from the random IP issue (#517), but the same applies. Some use-cases would help us determine the viability of this feature.

Hey there @bschaatsbergen 👋, thanks for raising this issue!

Just wanted to quickly point out, since the random provider is so heavily used by the community, one of the main design goals is stability over features. That's not to say we won't accept any new feature, but rather we want to ensure that new features aren't being added without ample design consideration. Another piece of consideration alongside this is general interest from the community.

The feature requested here is an expansion of what the random provider does today and it does feel like it could lead the provider down a "slippery slope" of new features related to context-specific random strings. (random time, dates, IPs, emails, etc.)

If the main drive behind this new resource is also to be used as test data (similar to #517), that might make it a good candidate to live in a new provider that focuses on generating realistic mock test data, a Terraform sibling of something like faker-js. The recent addition of test mocking in Terraform 1.7 might make providers that produce realistic fake data like that more desirable.

If there are any use-cases for random dates that are not mocking/test data specific, we would be interested to hear about those.

I'm copying my response from the random IP issue (#517), but the same applies. Some use-cases would help us determine the viability of this feature.

Hey there @bschaatsbergen 👋, thanks for raising this issue!

Just wanted to quickly point out, since the random provider is so heavily used by the community, one of the main design goals is stability over features. That's not to say we won't accept any new feature, but rather we want to ensure that new features aren't being added without ample design consideration. Another piece of consideration alongside this is general interest from the community.

The feature requested here is an expansion of what the random provider does today and it does feel like it could lead the provider down a "slippery slope" of new features related to context-specific random strings. (random time, dates, IPs, emails, etc.)

If the main drive behind this new resource is also to be used as test data (similar to #517), that might make it a good candidate to live in a new provider that focuses on generating realistic mock test data, a Terraform sibling of something like faker-js. The recent addition of test mocking in Terraform 1.7 might make providers that produce realistic fake data like that more desirable.

If there are any use-cases for random dates that are not mocking/test data specific, we would be interested to hear about those.

Thanks for the extensive feedback, find my reply here: #517 (comment)