Skip to content

Commit 1edf48f

Browse files
committed
update readme
1 parent aaca6ec commit 1edf48f

File tree

1 file changed

+57
-11
lines changed

1 file changed

+57
-11
lines changed

README.md

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,68 @@
1-
# Terraform State Storage Backend for GitHub Tokens
1+
# TFState.dev
22

3-
This is a REST API for storing Terraform State using a Terraform HTTP State.
3+
**TFstate.dev** is a free [Terraform State Provider](https://www.terraform.io/language/settings/backends/http) and [Open Source Hosted Service](https://github.com/tfstate/github-sls-rest-api) for secure Terraform Remote State hosting using a GitHub Token, courtsey of [Scaffoldly](https://scaffold.ly)
44

5-
Authentication and authorization is done using a GitHub token.
5+
Features:
66

7-
## Using this API
7+
- GitHub Token used for Authentication and Authorization to Terraform State
8+
- Encrypted State in Amazon S3 using Amazon KMS
9+
- State Locking
10+
- Highly available [Hosted API](https://api.tfstate.dev/github/swagger.html) in AWS Lambda + API Gateway
11+
- Plug and Play: Only a GitHub Token is needed to use TFstate.dev
812

9-
This API is publicly hosted at:
13+
✅ We do not store or save the provided GitHub token.
1014

11-
https://api.tfstate.dev/github/swagger.html
15+
---
1216

13-
To use it in Terraform, please see the documentation here:
17+
## Getting started 🚀
1418

15-
[TFstate.dev Homepage](https://tfstate.dev)
19+
First, a GitHub token is needed. This can be a [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token), a [GitHub Actions Secret](https://docs.github.com/en/actions/security-guides/automatic-token-authentication), or any other form of [GitHub Oauth Token](https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/). At a minimum, the token needs `repo:read` access for the configured repository.
1620

17-
## Developing/Contributing to this API
21+
➡ See our [example repository](https://github.com/tfstate/example).
22+
23+
To use TFstate.dev in Terraform, add the following [backend configuration](https://www.terraform.io/language/settings/backends/http) to Terraform:
24+
25+
```hcl
26+
terraform {
27+
backend "http" {
28+
address = "https://api.tfstate.dev/github/v1"
29+
lock_address = "https://api.tfstate.dev/github/v1/lock"
30+
unlock_address = "https://api.tfstate.dev/github/v1/lock"
31+
lock_method = "PUT"
32+
unlock_method = "DELETE"
33+
username = "{your-github-org}/{your-github-repo}"
34+
}
35+
}
36+
```
37+
38+
Then, Terraform can be configured to use the TFstate.dev backend using the GitHub token:
39+
40+
```bash
41+
terraform init -backend-config="password={your-github-token}"
42+
terraform plan
43+
terraform apply
44+
```
45+
46+
Alternatively, the `TF_HTTP_PASSWORD` environment variable can be set with the GitHub token:
47+
48+
```bash
49+
export TF_HTTP_PASSWORD="{your-github-token}"
50+
terraform init
51+
terraform plan
52+
terraform apply
53+
```
54+
55+
For more information go to [TFstate.dev](https://tfstate.dev)!
56+
57+
---
58+
59+
## Want to Contribute?
60+
61+
### Developing/Contributing to this API
1862

1963
We'd love contributions from the community to improve this API.
2064

21-
### Running
65+
#### Running
2266

2367
Requirements:
2468

@@ -37,7 +81,7 @@ Once running locally, the OpenAPI docs can be found at:
3781

3882
https://localhost:3000/github/swagger.html
3983

40-
### Verifying Locally
84+
#### Verifying Locally
4185

4286
While running the API locally, create a basic Terraform structure to test state functions:
4387

@@ -104,3 +148,5 @@ distributed under the License is distributed on an "AS IS" BASIS,
104148
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105149
See the License for the specific language governing permissions and
106150
limitations under the License.
151+
152+
![](https://sly-dev.scaffold.ly/auth/px?tfstate-github-readme)

0 commit comments

Comments
 (0)