Skip to content

tfstate/github-sls-rest-api

Repository files navigation

Terraform Remote State Management using a GitHub Token

Scaffoldly provides a Remote State API for secure Terraform Remote State hosting using a GitHub Token.

Features:

✅ We do not store or save the provided GitHub token.

Usage

1. Create a tfstate.tfbackend file with a GitHub Token with repo or repo:read access to the Repository specified by username:

username = "my-org/my-repo"
password = "ghp_abcd..."

Note: Be sure to exclude tfstate.tfbackend from source control in the .gitignore.

Note: This can be a Personal Access Token or a token generated by GitHub OAuth

2. Configure Terraform for Remote State

terraform {
  backend "http" {
    address        = "https://api.tfstate.dev/github/v1"
    lock_address   = "https://api.tfstate.dev/github/v1/lock"
    unlock_address = "https://api.tfstate.dev/github/v1/lock"
    lock_method    = "PUT"
    unlock_method  = "DELETE"
  }
}

3. Initialize Terraform

terraform init -backend-config=tfstate.tfbackend -reconfigure [-migrate-state]

Note: If you have a token that rotates regularly (such as Server-to-Server) tokens generated by a GitHub Application, you will need to run -reconfigure each time the token rotates.

See the Terraform Docs for specifics on migrating existing state.

Questions/Comments/Issues?

Please create a new issue on GitHub.

Maintainers

About Scaffoldly and tfstate.dev

Scaffoldly provides various services and automations to simplify Infrastructure Bootstrapping and DevOps.

tfstate.dev is provided as a free and easy way to store Terraform State. We've open sourced it for transparency to show how it handles and secures Terraform state.

We were inspired by GitLab's ability to host Terraform State, and wanted the same functionality for GitHub.

Scaffoldly is not affiliated with GitHub.

Want to host github-sls-rest-api in your own AWS Account?

Scaffoldly can help!

Message us on Gitter for details.

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy