Skip to content

threefoldtech/terraform-provider-grid

Repository files navigation

Grid provider for terraform

Codacy Badge Testing Testing Testing Dependabot

A terraform provider for the threefold grid to manage your infrastructure using terraform.

Requirements

Using provider for different environments

  • to use the mainnet's version of the provider for v1.7.0, use the following configs:

    terraform {
      required_providers {
        grid = {
          source = "threefoldtech/grid"
        }
      }
    }
  • to use the testnet's version of the provider for v1.7.0, use the following configs:

    terraform{
      required_providers{
        grid = {
          source = "threeflodtech/grid"
          version = "1.7.0-rcX"
        }
      }
    }
  • for devnet, qanet use <VERSION>-dev and <VERSION>-qa respectivly

Generating the docs

make docs

Using the provider

cd examples/resources/singlenode
export MNEMONIC="mnemonic words"
export NETWORK="network" # dev, qa, test, main
terraform init && terraform apply # creates resources defined in main.tf
terraform destroy # destroy the created resource
  • For a tutorials, please visit the wiki page.
  • Detailed docs for resources and their arguments can be found in the docs.

Building The Provider (for development only)

make

Run tests

export MNEMONIC="mnemonic words"
export NETWORK="network" # dev, qa, test, main
  • Unit tests

    make unittests
  • Integration tests

    make integration
    • if you want to run one test use:

      cd integrationtests
      go test . -run <TestNameFunction> -v --tags=integration 
      go test . -run <TestNameFunction/SubFunctionName> -v --tags=integration #for testing only one sub-function

Known Issues

Latest Releases

Using example directory

  • the examples directory contains some examples to show user how to use the provider so kindly note that
    • User should change the nodes to match the node that wants to deploy on
    • In examples that usesSSH_KEY default location is file("~/.ssh/id_rsa.pub") the path should be changed to match your public key location