terraform-provider-utils

module
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2022 License: MPL-2.0

README

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 dep for dependency management. Dependencies are tracked as part of the repository.

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 git@github.com:wayfair/terraform-provider-utils.git
    
  2. Include the utility repo in your provider:

    Update your Gopkg.toml to include the repo as a dependency:

    # Gopkg.toml
    
    [[constraint]]
      name = "github.com/wayfair/terraform-provider-utils"
      # constraint to a specific version, release here:
      version = "=1.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"
    )
    
    // ...
    

    Update your repository to include the constraint with dep:

    $> dep ensure
    

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.

To generate and view the entire repository's documentation:

$> 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.

Directories

Path Synopsis
Package autodoc contains the engine for the autodoc command line application to automatically generate mkdocs-style documentation for the provider.
Package autodoc contains the engine for the autodoc command line application to automatically generate mkdocs-style documentation for the provider.
Package conv contains functions to gracefully handle conversions of types, such as asserting interface values to concrete types.
Package conv contains functions to gracefully handle conversions of types, such as asserting interface values to concrete types.
Package helper contains schema.Schema helper functions.
Package helper contains schema.Schema helper functions.
Package log extends the capabilities of the Golang stdlib "log" package.
Package log extends the capabilities of the Golang stdlib "log" package.
Package rand contains randomization functions for use in unit/regression/integration tests or anywhere where randomized data is needed.
Package rand contains randomization functions for use in unit/regression/integration tests or anywhere where randomized data is needed.
Package validation contains schema.Schema validation functions.
Package validation contains schema.Schema validation functions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL