terraform-provider-http icon indicating copy to clipboard operation
terraform-provider-http copied to clipboard

Add option to cache response for a TTL

Open mmueller-rs opened this issue 1 year ago • 0 comments

Terraform CLI and Provider Versions

Terraform v1.9.5
on darwin_arm64
+ provider registry.terraform.io/hashicorp/http v3.4.4
+ provider registry.terraform.io/hashicorp/kubernetes v2.32.0
+ provider registry.terraform.io/hashicorp/local v2.5.1
+ provider registry.terraform.io/hashicorp/null v3.2.2

Use Cases or Problem Statement

We're planning to use the http provider to query a REST Api and receive a Token that we'll use in the provider-configuration of another provider. Every time the Terraform code is planned or applied, a new Token is created, causing lots of requests to the API-Server, as well as planned changes on every run/plan. Especially during development of a new feature, this can become quite messy.

Proposal

It would be great if one could specify a TTL for the Response, so that the result of the Statefile could be reused as long as it's still valid. Default should be 0.

How much impact is this issue causing?

Low

Additional Information

A similar request can be found in https://github.com/hashicorp/terraform-provider-http/issues/335, but the difference is that in my case, the result of a previous run should be used. But maybe the solution to the two issues could be combined.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

mmueller-rs avatar Aug 22 '24 11:08 mmueller-rs