Skip to content

andreygubarev/terraform-backend-github

Repository files navigation

Terraform HTTP Backend backed by GitHub

Terraform HTTP backend that uses Github as a storage backend.

Usage

Run the container using the following docker-compose snippet:

version: '3'

services:
  terraform-backend-github:
    image: ghcr.io/andreygubarev/terraform-backend-github:latest
    environment:
      - GITHUB_TOKEN=${GITHUB_TOKEN}
    ports:
      - 8080:8080
    restart: unless-stopped

Configure the Terraform HTTP backend in your Terraform configuration:

terraform {
  backend "http" {
    address = "http://localhost:8080/andreygubarev/terraform-backend/state/terraform.tfstate"
    lock_address = "http://localhost:8080/andreygubarev/terraform-backend/state/terraform.tfstate.lock"
    unlock_address = "http://localhost:8080/andreygubarev/terraform-backend/state/terraform.tfstate.lock"
  }
}

Motivation

Reference