GithubHelp home page GithubHelp logo

snowplow-devops / porter-terraform Goto Github PK

View Code? Open in Web Editor NEW

This project forked from getporter/terraform-mixin

0.0 1.0 0.0 1.76 MB

A Terraform Mixin for Porter

Home Page: https://porter.sh

License: MIT License

Makefile 9.23% Go 74.94% JavaScript 15.83%

porter-terraform's Introduction

terraform Mixin for Porter

This is a terraform mixin for Porter.

Build from source

This will get the terraform mixin and install it from source.

  1. go get -u get.porter.sh/mixin/terraform
  2. cd $(go env GOPATH)/src/get.porter.sh/mixin/terraform
  3. make build install

Examples

Install

install:
  - terraform:
      description: "Install Azure Key Vault"
      input: false
      backendConfig:
        key: "mybundle.tfstate"
        storage_account_name: "mystorageacct"
        container_name: "mycontainer"
        access_key: "myaccesskey"
      outputs:
      - name: vault_uri

Upgrade

upgrade:
  - terraform:
      description: "Upgrade Azure Key Vault"
      input: false
      backendConfig:
        key: "mybundle.tfstate"
        storage_account_name: "mystorageacct"
        container_name: "mycontainer"
        access_key: "myaccesskey"
      outputs:
      - name: vault_uri

Invoke

An invoke step is used for any custom action (not one of install, upgrade or uninstall).

By default, the command given to terraform will be the step name. Here it is show, resulting in terraform show with the provided configuration.

show:
  - terraform:
      description: "Invoke 'terraform show'"
      backendConfig:
        key: "mybundle.tfstate"
        storage_account_name: "mystorageacct"
        container_name: "mycontainer"
        access_key: "myaccesskey"

Or, if the step name does not match the intended terraform command, the command can be supplied via the arguments: section, like so:

printVersion:
  - terraform:
      description: "Invoke 'terraform version'"
      arguments:
        - version

Uninstall

uninstall:
  - terraform:
      description: "Uninstall Azure Key Vault"
      backendConfig:
        key: "mybundle.tfstate"
        storage_account_name: "mystorageacct"
        container_name: "mycontainer"
        access_key: "myaccesskey"

See further examples in the Examples directory

Outputs

As seen above, outputs can be declared for a step. All that is needed is the name of the output.

For each output listed, terraform output <output name> is invoked to fetch the output value from the state file for use by Porter.

See the Porter Outputs documentation on how to wire up outputs for use in a bundle.

porter-terraform's People

Contributors

carolynvs-msft avatar jdolitsky avatar jeremyrickard avatar jrluis avatar vdice avatar

Watchers

 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.