{"id":13451669,"url":"https://github.com/Mastercard/terraform-provider-restapi","last_synced_at":"2025-03-23T19:32:20.190Z","repository":{"id":32041094,"uuid":"131317436","full_name":"Mastercard/terraform-provider-restapi","owner":"Mastercard","description":"A terraform provider to manage objects in a RESTful API","archived":false,"fork":false,"pushed_at":"2024-06-27T13:57:50.000Z","size":323,"stargazers_count":782,"open_issues_count":68,"forks_count":213,"subscribers_count":21,"default_branch":"master","last_synced_at":"2024-07-02T14:46:25.106Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mastercard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-27T15:58:44.000Z","updated_at":"2024-06-22T17:48:02.000Z","dependencies_parsed_at":"2023-10-13T06:02:57.898Z","dependency_job_id":"799a9413-d8ea-4aa0-bc49-d0625318183e","html_url":"https://github.com/Mastercard/terraform-provider-restapi","commit_stats":{"total_commits":254,"total_committers":39,"mean_commits":6.512820512820513,"dds":0.6535433070866141,"last_synced_commit":"f66246a709a03c263216d85b1f35ec7a821c4724"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastercard%2Fterraform-provider-restapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastercard%2Fterraform-provider-restapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastercard%2Fterraform-provider-restapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mastercard%2Fterraform-provider-restapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mastercard","download_url":"https://codeload.github.com/Mastercard/terraform-provider-restapi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213325059,"owners_count":15570229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T07:00:58.600Z","updated_at":"2024-07-31T07:03:54.335Z","avatar_url":"https://github.com/Mastercard.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/burbon/terraform-provider-restapi.svg?branch=master)](https://travis-ci.com/burbon/terraform-provider-restapi)\n[![Coverage Status](https://coveralls.io/repos/github/burbon/terraform-provider-restapi/badge.svg?branch=master)](https://coveralls.io/github/burbon/terraform-provider-restapi?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/burbon/terraform-provider-restapi)](https://goreportcard.com/report/github.com/burbon/terraform-provider-restapi)\n# Terraform provider for generic REST APIs\n\n## Maintenance Note\nThis provider is largely feature-complete and in maintenance mode.\n* It's not dead - it's just slow moving and updates must be done very carefully\n* We encourage community participation with open issues for usage and remain welcoming of pull requests\n* Code updates happen sporadically throughout the year, driven primarily by security fixes and PRs\n* Because of the many API variations and flexibility of this provider, detailed per-API troubleshooting cannot be guaranteed\n\n\u0026nbsp;\n\n## About This Provider\nThis terraform provider allows you to interact with APIs that may not yet have a first-class provider available by implementing a \"dumb\" REST API client.\n\nThis provider is essentially created to be a terraform-wrapped `cURL` client. Because of this, you need to know quite a bit about the API you are interacting with as opposed to full-featured terraform providers written with a specific API in mind.\n\nThere are a few requirements about how the API must work for this provider to be able to do its thing:\n* The API is expected to support the following HTTP methods:\n    * POST: create an object\n    * GET: read an object\n    * PUT: update an object\n    * DELETE: remove an object\n* An \"object\" in the API has a unique identifier the API will return\n* Objects live under a distinct path such that for the path `/api/v1/things`...\n    * POST on `/api/v1/things` creates a new object\n    * GET, PUT and DELETE on `/api/v1/things/{id}` manages an existing object\n\nHave a look at the [examples directory](examples) for some use cases.\n\n\u0026nbsp;\n\n## Provider Documentation\nThis provider has only a few moving components, but LOTS of configurable parameters:\n* [provider documentation](https://registry.terraform.io/providers/Mastercard/restapi/latest/docs)\n* [restapi_object resource documentation](https://registry.terraform.io/providers/Mastercard/restapi/latest/docs/resources/object)\n* [restapi_object datasource documentation](https://registry.terraform.io/providers/Mastercard/restapi/latest/docs/data-sources/object)\n\n\u0026nbsp;\n\n## Usage\n* Try to set as few parameters as possible to begin with. The more complicated the configuration gets, the more difficult troubleshooting can become.\n* Play with the [fakeserver cli tool](fakeservercli/) (included in releases) to get a feel for how this API client is expected to work. Also see the [examples directory](examples) directory for some working use cases with fakeserver.\n* By default, data isn't considered sensitive. If you want to hide the data this provider submits as well as the data returned by the API, you would need to set environment variable `API_DATA_IS_SENSITIVE=true`.\n* The `*_path` elements are for very specific use cases where one might initially create an object in one location, but read/update/delete it on another path. For this reason, they allow for substitution to be done by the provider internally by injecting the `id` somewhere along the path. This is similar to terraform's substitution syntax in the form of `${variable.name}`, but must be done within the provider due to structure. The only substitution available is to replace the string `{id}` with the internal (terraform) `id` of the object as learned by the `id_attribute`.\n\n\u0026nbsp;\n\n### Troubleshooting\nBecause this provider is just a terraform-wrapped `cURL`, the API details and the go implementation of this client are often leaked to you.\nThis means you, as the user, will have a bit more troubleshooting on your hands than would typically be required of a full-fledged provider if you experience issues.\n\nHere are some tips for troubleshooting that may be helpful...\n\n\u0026nbsp;\n\n#### Debug log\n**Rely heavily on the debug log.** The debug log, enabled by setting the environment variable `TF_LOG=1` and enabling the `debug` parameter on the provider, is the best way to figure out what is happening.\n\nIf an unexpected error occurs, enable debug log and review the output:\n* Does the API return an odd HTTP response code? This is common for bad requests to the API. Look closely at the HTTP request details.\n* Does an unexpected golang 'unmarshaling' error occur? Take a look at the debug log and see if anything other than a hash (for resources) or an array (for the datasource) is being returned. For example, the provider cannot cope with cases where a JSON object is requested, but an array of JSON objects is returned.\n\n\u0026nbsp;\n\n### Importing existing resources\nThis provider supports importing existing resources into the terraform state. Import is done according to the various provider/resource configuation settings to contact the API server and obtain data. That is: if a custom read method, path, or id attribute is defined, the provider will honor those settings to pull data in.\n\nTo import data:\n`terraform import restapi.Name /path/to/resource`.\n\nSee a concrete example [here](examples/workingexamples/dummy_users_with_fakeserver.tf).\n\n\u0026nbsp;\n\n## Installation\nThere are two standard methods of installing this provider detailed [in Terraform's documentation](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins). You can place the file in the directory of your .tf file in `terraform.d/plugins/{OS}_{ARCH}/` or place it in your home directory at `~/.terraform.d/plugins/{OS}_{ARCH}/`.\n\nThe released binaries are named `terraform-provider-restapi_vX.Y.Z-{OS}-{ARCH}` so you know which binary to install. You *may* need to rename the binary you use during installation to just `terraform-provider-restapi_vX.Y.Z`.\n\nOnce downloaded, be sure to make the plugin executable by running `chmod +x terraform-provider-restapi_vX.Y.Z-{OS}-{ARCH}`.\n\n\u0026nbsp;\n\n## Contributing\nPull requests are always welcome! Please be sure the following things are taken care of with your pull request:\n* `go fmt` is run before pushing\n* Be sure to add a test case for new functionality (or explain why this cannot be done)\n* Run the `scripts/test.sh` script to be sure everything works\n* Ensure new attributes can also be set by environment variables\n\n#### Development environment requirements:\n* [Golang](https://golang.org/dl/) v1.11 or newer is installed and `go` is in your path\n* [Terraform](https://www.terraform.io/downloads.html) is installed and `terraform` is in your path\n\nTo make development easy, you can use the Docker image [druggeri/tdk](https://hub.docker.com/r/druggeri/tdk) as a development environment:\n```\ndocker run -it --name tdk --rm -v \"$HOME/go\":/root/go druggeri/tdk\ngo get github.com/Mastercard/terraform-provider-restapi\ncd ~/go/src/github.com/Mastercard/terraform-provider-restapi\n#Hack hack hack\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMastercard%2Fterraform-provider-restapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMastercard%2Fterraform-provider-restapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMastercard%2Fterraform-provider-restapi/lists"}