Mastercard / terraform-provider-restapi

A terraform provider to manage objects in a RESTful API
Other
808 stars 217 forks source link

Pulling in data from endpoint with no query parameters? #245

Open tobiasbp opened 12 months ago

tobiasbp commented 12 months ago

I have and endpoint, /orgs, returning a list or organizations. I'm unsure if this provider supports importing the organization data into Terraform? I want to import data from the API, but never update data via the API.

I would like to do something like this:

data "restapi_object" "orgs" {
  path = "/orgs"
}

However, _searchkey & _searchvalue (I think those are sent in the request body?) are required fields, but I have no search values to provide. Also, I think each data object is expected to hold a single org (in this scenario), so what I'm trying do is probably different than what the intended use of this provider is?

I'm also wondering if it is possible to query and endpoint which only accepts query strings (no support for arguments sent as a JSON in the request body)?

I am currently using the Hashicorp HTP provider to get data from my endpoint, but I'm getting throttled, and the HTTP provider does not support setting a _ratelimit. That is why I am looking for alternatives. I'd rather not write my own provider for getting the data.

Any suggestions much appreciated.

maxexcloo commented 2 weeks ago

Would use this also - did you find any other solution?