Giter Club home page Giter Club logo

terraform-provider-utils's Introduction

Terraform Provider Utilities

This repository contains utility functions, packages used in the other in-house developed Terraform providers. Common and core functionality is commited to this repository and used in other codebases.

This project is a component of Project Argo.

Project Info

This project is developed, owned, and maintained by the SRE - Orchestration pod at Wayfair.

This repository uses mkdocs for documentation and go modules for dependency management. Dependencies are tracked as part of the repository in vendor/.

Requirements:

Follow the setup instructions provided on the install sections of their respective websites. Windows environments should have a *nix-style terminal emulator installed such as Cygwin to be compatible with the makefile.

Repository Setup

After installing and configuring the toolchain listed in the Requirements section:

  1. Clone the repository with ssh:

    $ mkdir -p "${GOPATH}/src/github.com/wayfair"
    $ cd "${GOPATH}/src/github.com/wayfair"
    $ git clone [email protected]:wayfair/terraform-provider-utils.git
  2. Include the utility repo in your provider:

    SEE Go Wiki - Modules#daily-workflow for more information.

    Update your go.mod to include the repo as a dependency:

    # go.mod
    
    require github.com/wayfair/terraform-provider-utils v2.0.0
    

    Include the needed package(s) to your source files:

    // resource_example_foo.go
    //
    // Example provider, foo resource
    
    package example
    
    import (
        // Import a specific subpackage from the repo, in this case 'example'.
        // Here, we don't define a pseudonym, so the package is accessible by
        // 'example'.
        "github.com/wayfair/terraform-provider-utils/example"
        // Here we are importing the 'example2' package under the pseudonym
        // 'ex'. It is available in this file as 'ex' not 'example2'
        ex "github.com/wayfair/terraform-provider-utils/example2"
    )
    
    // ...
    

Documentation

This repository uses mkdocs for documentation. Repository documentation can be found in the doc directory. Follow the installation instructions on mkdocs to get started.

The Makefile exposes a godoc target which can be used to generate and save the project's Godoc to the local filesystem in docs/godoc. These pages are used by mkdocs to generate the full project documentation. The godoc target only saves the necessary package documentation for this repository and does save the entire webroot.

To generate and view the entire repository's documentation:

$> make godoc
Generating godoc to docs/godoc...
Creating docs/godoc
godoc PID: [5084]
Sleeping while godoc initializes...
Downloading pages...
<...output truncated...>
done.
Killing godoc process [5084]

$> mkdocs serve
INFO    -  Building documentation...
INFO    -  Cleaning site directory
[I 160402 15:50:43 server:271] Serving on http://127.0.0.1:8000
[I 160402 15:50:43 handlers:58] Start watching changes
[I 160402 15:50:43 handlers:60] Start detecting changes

The documentation can then be viewed by accessing localhost in your favorite browser or viewport.

Cleaning up the generated godoc can be done with the clean-godoc target.

$> make clean-godoc
Cleaning godoc files...

terraform-provider-utils's People

Contributors

ishashchuk avatar mcgarebear avatar bmcgarry-wayfair avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.