https://github.com/rios0rios0/terraform-provider-http
Terraform provider for HTTP requests with state storage. Executes HTTP calls and stores responses in Terraform state for use in subsequent requests. Complements hashicorp/http provider.
https://github.com/rios0rios0/terraform-provider-http
api-integration golang http-requests infrastructure-as-code terraform-provider
Last synced: about 2 months ago
JSON representation
Terraform provider for HTTP requests with state storage. Executes HTTP calls and stores responses in Terraform state for use in subsequent requests. Complements hashicorp/http provider.
- Host: GitHub
- URL: https://github.com/rios0rios0/terraform-provider-http
- Owner: rios0rios0
- License: mit
- Created: 2024-08-23T23:54:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-30T23:37:23.000Z (3 months ago)
- Last Synced: 2026-03-31T01:36:18.576Z (3 months ago)
- Topics: api-integration, golang, http-requests, infrastructure-as-code, terraform-provider
- Language: Go
- Homepage: https://registry.terraform.io/providers/rios0rios0/http/latest
- Size: 287 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Terraform Provider HTTP
A Terraform provider that facilitates the execution of HTTP requests and enables the storage of responses within the Terraform state. The primary advantage is the ability to utilize stored responses in subsequent requests.
While this provider is not designed to replace the [http](https://registry.terraform.io/providers/hashicorp/http/latest/docs) provider, it can be used alongside it. Notably, the official [http](https://registry.terraform.io/providers/hashicorp/http/latest/docs) provider does not store responses in the state, which limits its ability to use responses in future requests.
This provider supports specifying the URL, method, and headers, and it captures both the response body and response code.
## Requirements
- [Go](https://golang.org/doc/install) >= 1.23.4
- [Terraform](https://www.terraform.io/downloads.html) >= 1.10.4 (tested and approved)
## Installation
Add the provider to your Terraform configuration:
```hcl
terraform {
required_providers {
http = {
source = "rios0rios0/http"
}
}
}
```
## Usage
```hcl
resource "http_request" "example" {
url = "https://api.example.com/data"
method = "GET"
headers = {
"Authorization" = "Bearer ${var.token}"
}
}
output "response_body" {
value = http_request.example.response_body
}
```
## Contributing
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## References
- [Terraform Plugin Framework](https://developer.hashicorp.com/terraform/plugin/framework/resources/create)
- [Develop a Terraform provider (Terraform HashiCups Provider)](https://github.com/hashicorp/terraform-provider-hashicups)
- [Terraform Provider Scaffolding (Terraform Plugin Framework)](https://github.com/hashicorp/terraform-provider-scaffolding-framework)
- [Standard Go Project Layout](https://github.com/golang-standards/project-layout/tree/master?tab=readme-ov-file)