Feature/issue 300 - Http Resource #558
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Issue
Fixes #300
Description
This pull request introduces a new
http
resource to the provider. Thehttp
resource allows users to perform HTTP requests as part of their Terraform apply or destroy operations, capturing response data such as headers, body, and status code in the Terraform state.Key design decisions and features:
GET
,HEAD
, andPOST
methods, with optional request headers and body.when
argument that allows users to control whether the request is sent during apply (create/update) or destroy.when
attribute without affecting the existing data-source module.when
are "apply" and "destroy"when = "apply"
(default):The provider sends the request during create and update operations. Computed response values are saved to the state file.
when = "destroy"
:The provider sends the request only during resource deletion. During
terraform apply
, computed response attributes will be empty or zero, while input attributes are stored as provided.go-retryablehttp
.docs/
andexamples/
directories.internal/provider/resource_http_test.go
.This design provides flexibility for users needing to trigger HTTP endpoints as part of their infrastructure workflows, while maintaining a clear separation from the existing data source.
Files added/modified (main...feature/issue-300)
Rollback Plan
Changes to Security Controls
Changes to Security Controls
resource/http
implementation reuses the request-handling logic fromdata-source/http
, ensuring consistency in behavior.data-source/http
.Sample Plan