• Stars
    star
    379
  • Rank 113,004 (Top 3 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terraform helper. Terrahelp is as a command line utility written in Go and is aimed at providing supplementary functionality which can sometimes prove useful when working with Terraform.

Travis CI ReportCard

Terrahelp

Terraforming, with a little help from your friends

Terrahelp is as a command line utility written in Go and is aimed at providing supplementary functionality which can sometimes prove useful when working with Terraform.

At present, it offers the following:

  • Encryption & decryption functionality. Run in either full or inline mode, and leveraging either a simple or Vault based encryption provider, this functionality provides the ability to encrypt and decrypt files such as terraform.tfstate files, as well as piped in output from commands such as terraform apply etc.

  • Masking functionality. If you don't want to encrypt sensitive data, but rather just mask it out with something like ***** then you can use the mask command instead. This can either be run over a file, or have the content piped into it.

For more details, and some examples of how to use it please see the example READMEs.

Additionally the blog post Securing Terraform State with Vault also provides more details and background as well.

    NAME:
       terrahelp - Provides additional functions helpful with terraform development

    USAGE:
       terrahelp [global options] command [command options] [arguments...]

    VERSION:
       X.X.X

    AUTHOR(S):
       https://github.com/opencredo OpenCredo - Nicki Watt

    COMMANDS:
        vault-autoconfig	Auto configures Vault with a basic setup to support encrypt and decrypt actions.
        encrypt		        Uses configured provider to encrypt specified content
        decrypt		        Uses configured provider to decrypt specified content
        mask                    Mask will overwrite sensitive data in output or files with a masked value (eg. ******).
        help, h                 Shows a list of commands or help for one command

    GLOBAL OPTIONS:
       --help, -h		show help
       --version, -v	print the version

Installation

macOS

Install using Homebrew:

brew install terrahelp
terrahelp -v

Manual Installation Using the Pre-Built Binaries

Available from the Terrahelp repository's releases page

The community has also made it available as a Terrahelp AUR package

macOS, Linux & *BSD

Download a binary, set the correct permissions, add to your PATH:

chmod +x terrahelp
export PATH=$PATH:/wherever/terrahelp

And run it:

terrahelp --help
macOS Additional Step

terrahelp may be prevented from running if you downloaded it using a web browser. To fix this, remove the quarantine attribute before running again:

xattr -d com.apple.quarantine terrahelp

Windows

Not yet supported

Build from source

Prerequisites

Install Go (Terrahelp is currently built against 1.16.x). The following official resources will guide you through your environment setup.

Clone the Terrahelp repository.

mkdir -p "$GOPATH/src/github.com/opencredo/"
git clone https://github.com/opencredo/terrahelp.git "$GOPATH/src/github.com/opencredo/terrahelp"
cd "$GOPATH/src/github.com/opencredo/terrahelp"

Dependencies

Terrahelp uses Go modules to manage it's dependencies. During Go's transition to switching on modules by default, Terrahelp is setup to buildusing the vendor directory. Supportive targets are prvoided to allow the vendor directory to be recreated if required.

Building and Executing

After a build has completed successfully a binary will be built and placed into a local bin directory. The following commands build and execute terrahelp.

make build
./bin/terrahelp -v

Testing

make test

Installing and Executing

Installation places the binary in the $GOPATH/bin directory. Assuming that the directory has been added to your PATH, the following commands will install and execute Terrahelp.

make install
terrahelp -v

Want to cross compile it?

The make file allows both OSX and Linux binaries to be created at the same time or individually. The following commands show joint creation followed by OSX, (darwin) then Linux creation. All cross compiled binaries will be placed in a dist directory.

make dist
make darwin
make linux

Clean your project

A number of work directories will have been created through the previous build steps. The local bin and dist directories will contain binaries. The following command can be used to return the project back to a pre build state.

make clean

Dependency management

The following targets have been created to allow dependencies to be managed through Go modules. As mentioned before Terrahelp builds using the vendor directory.

  • make dependencies
    • Downloads the dependencies to the Go modules cache.
  • make tidy-dependencies
    • Adds missing and removes unused modules.
  • make vendor-dependencies
    • Copies the dependencies into the local vendor directory.
  • make clean-dependencies
    • Removes the local vendor directory.

NOTE: The Makefile defines a variable called BUILDARGS and this is currently set with -mod=vendor. This instructs various go commands to use the vendor directory. This can be overridden to build to project using standard go module flows.

BUILDARGS='' make build

Releasing

Brew

NOTE: This step should be performed after a new version of terrahelp has been released.

Follow the instructions outlined in Submit a new version of an existing formula to update the version of terrahelp installed by Brew.

For reference, the formula can be viewed in the homebrew-core repository here.

More Repositories

1

kubefuse

Kubernetes as a FUSE Filesystem
Python
266
star
2

test-automation-quickstart

Quickstart project for test automation, covering performance, ui acceptance and api acceptance testing
Java
144
star
3

concursus

Java
93
star
4

opencredo-react-boilerplate

JavaScript
64
star
5

proxology

Java
64
star
6

letsencrypt-terraform

Example source code for the blog "Let's Encrypt and Terraform - Getting free certificates for your infrastructure" - https://opencredo.com/letsencrypt-terraform
HCL
57
star
7

neo4j-in-action

Java
37
star
8

opencredo-esper

Spring support classes for Esper
Java
27
star
9

ruby-acceptance-testing-quickstart

A quickstart project to start web acceptance testing within minutes.
Ruby
26
star
10

angular2-boilerplate

TypeScript
24
star
11

mesos_framework_demo

A sample Mesos framework
Java
19
star
12

tornado-analytics

JavaScript
18
star
13

akka-java8-examples

Simple examples of using Akka Java 8 interface
Java
17
star
14

mesos_service_discovery

Service Discovery script for Mesos and Marathon
Go
15
star
15

js-api-testing-quickstart

A quickstart project for testing APIs with javascript, mocha and chai
JavaScript
15
star
16

springkoans

Koans for the Programming Spring book from O'Reilly
Java
14
star
17

kafka-connect-venafi

Kafka connector for Venafi Security Events
Java
12
star
18

spring-data-cassandra-example

Java
10
star
19

golang-api-test-quickstart

Test APIs with golang
Go
8
star
20

self-testing-vault

Ruby
7
star
21

log-classifier

Log Classifier
Python
4
star
22

cassandra-spark-ansible

Jinja
3
star
23

secure-pipeline-verifier

PoC for Secure CI/CD Pipeline project that makes use of policy-as-code to check configuration and settings in a repository making use of GitHub REST APIs or GitLab REST APIs and Open Policy Agent OPA
Go
3
star
24

opa-single-message-transformer

A single message transformer that filters based on OPA policies
Java
3
star
25

si-cep-samples

Java
2
star
26

springboot-workshops

JavaScript
2
star
27

vault-pki-demo

Shell
1
star
28

hacking-k8s-on-mac

HCL
1
star
29

hierarchical-expansion-blog

A repository holding the companion notebook to the Hierarchical Expansion blog post
Jupyter Notebook
1
star
30

neo4j-puppet

Puppet module to install Neo4j Graph Database Server
Puppet
1
star
31

sample-terragrunt-bootstrap

When first adopting Terragrunt, there is a bootstrapping challenge around setting up remote state and locking resources.
HCL
1
star
32

neo4j-cluster

Neo4j development cluster
1
star