Socket
Socket
Sign inDemoInstall

github.com/psolru/terrastate-http

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/psolru/terrastate-http


Version published
Created
Source

Terrastate HTTP

A simple standalone webserver for Terraform HTTP remote state written in Go.

Features

  • Basic Authentication
  • State Locking
  • Overview of stored states

Usage

Known issue

  • For now you have to provide a JSON config file. The most minimum content has to be: {}
  1. Starting docker container:

    docker run --rm --detach \
      --name terrastate-http \
      --publish 8080:8080 \
      --volume $(pwd)/example-config.json:/mnt/configs/config.json \
      --volume $(pwd)/sqlite3/:/mnt/sqlite3/ \
      psolru/terrastate-http
    
  2. Configure Terraform (e.g. in backend.yml):

    terraform {
      backend "http" {
        address = "http://terrastate.example.com:8080/my_terraform_project"
        lock_address = "http://terrastate.example.com:8080/my_terraform_project/lock"
        unlock_address = "http://terrastate.example.com:8080/my_terraform_project/unlock"
        username = "my_username"
        password = "my_password"
      }
    }
    
  3. optional: Setup Reverse Proxy

  4. enjoy your secure, remote and self managed Terraform Statemanagement

SSL

SSL is currently not supported. You have to manage this by your own. (But i planned it to be a future feature.)

Routes

Terrastate is written by considering the specifications of Terraforms http backend.
Therefore the routes are self mostly explaining.
"/list" is an exception and added by the idea to have a slight overview of the stored states.

Overview:

  • "/list" [GET] - Returns all States and their ID, eg.: {"13":"my_fancy_cluster"}
  • "/{ident}" [GET]
  • "/{ident}" [POST]
  • "/{ident}/lock" [LOCK]
  • "/{ident}/unlock" [UNLOCK]

Notice / Contribution

This is my first go project. There are many things which could be done better and I already have a little todo list. If you think there are some critical things which should be prioritized please open an issue about it. Thank you!

FAQs

Package last updated on 28 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc