Skip to content
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

Feature Request: Random Date #518

Open
bschaatsbergen opened this issue Jan 20, 2024 · 2 comments
Open

Feature Request: Random Date #518

bschaatsbergen opened this issue Jan 20, 2024 · 2 comments

Comments

@bschaatsbergen
Copy link
Member

bschaatsbergen commented Jan 20, 2024

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. :)

@austinvalle
Copy link
Member

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.

@bschaatsbergen
Copy link
Member Author

bschaatsbergen commented Feb 12, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants