salrashid123 / terraform-provider-http-full

Terraform HTTP provider with mTLS and JSON POST support
Apache License 2.0
13 stars 4 forks source link

Resource for requests that modify, like POST/PUT/PATCH? #14

Closed gangefors closed 1 year ago

gangefors commented 1 year ago

I'm trying to use this provider since it can do POST/PUT/PATCH and other modifying REST requests, but I don't want the requests executed when running terraform plan. As it stands now, this provider will make modifying requests during the planning phase, which I would not expect from a Data Source. I can however see that it would in the current form since there is no differentiation between methods.

Would it be possible to provide a Resource that only executes the requests during the terraform apply phase?

I would also recommend adding a warning in the docs that requests will execute during the planning, so using methods that modify resources should be avoided when used as a Data Source.

salrashid123 commented 1 year ago

i havne't tried it but this provides a rest resource https://registry.terraform.io/providers/Mastercard/restapi/latest

gangefors commented 1 year ago

Ah, thanks for the tip. That might be a better fit for me.