Skip to content

Commit

Permalink
Adding DESIGN.md (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendbennett committed May 19, 2022
1 parent 60ed815 commit 127a442
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# HTTP Provider Design

The HTTP Provider offers functionality for interacting with generic HTTP servers as part of terraform configuration.
Specifically, the provider issues an HTTP GET request to the defined URL on every Terraform run.

Below we have a collection of _Goals_ and _Patterns_: they represent the guiding principles applied during the
development of this provider. Some are in place, others are ongoing processes, others are still just inspirational.

## Goals

* [_Stability over features_](.github/CONTRIBUTING.md)
* Provide managed data source to issue HTTP GET request.
* Support usage of requests to URLs directed to either `http` or `https`.
* Support the supplying of request headers.
* Expose response headers returned from request.
* Expose response body as string where applicable.

## Patterns

Specific to this provider:

* Only idempotent GET requests are supported.
* Only 200 status codes are considered successful.

General to development:

* **Avoid repetition**: the entities managed can sometimes require similar pieces of logic and/or schema to be realised.
When this happens it's important to keep the code shared in communal sections, so to avoid having to modify code in
multiple places when they start changing.
* **Test expectations as well as bugs**: While it's typical to write tests to exercise a new functionality, it's key to
also provide tests for issues that get identified and fixed, so to prove resolution as well as avoid regression.
* **Automate boring tasks**: Processes that are manual, repetitive and can be automated, should be. In addition to be a
time-saving practice, this ensures consistency and reduces human error (ex. static code analysis).
* **Semantic versioning**: Adhering to HashiCorp's own
[Versioning Specification](https://www.terraform.io/plugin/sdkv2/best-practices/versioning#versioning-specification)
ensures we provide a consistent practitioner experience, and a clear process to deprecation and decommission.

0 comments on commit 127a442

Please sign in to comment.