GithubHelp home page GithubHelp logo

servian / packer-plugin-terraform Goto Github PK

View Code? Open in Web Editor NEW
6.0 23.0 0.0 118 KB

A Packer plugin for provisioning with Terraform (local)

Home Page: https://medium.com/weareservian/how-not-to-use-terraform-31c9e7fe2607

License: Mozilla Public License 2.0

Shell 2.00% Go 84.48% HCL 9.71% Smarty 3.81%
packer-provisioner terraform packer packer-plugin

packer-plugin-terraform's Introduction

Packer Plugin Terraform

  • Build Status
  • license MPL-2.0
  • GoReportCard
  • Version

Inspired by Megan Marsh's talk https://www.hashicorp.com/resources/extending-packer I bit the bullet and started making my own ill advised provisioner for Terraform.

Usage

packer {
  required_plugins {
    terraform = {
      version = "= 0.0.7"
      source = "github.com/servian/terraform"
    }
  }
}

source "docker" "test_server" {
  commit = true
  image  = "amazonlinux:2"
}

build {
  sources = ["source.docker.test_server"]

  provisioner "terraform" {
    code_path       = "./tfcode"
    prevent_sudo    = "true"
    variable_string = jsonencode({
        consul_server_node = false
    })
    version = "1.0.0"
  }
}

parameters

  • version(string) - the version of Terraform to install
  • code_path(string) - (required) the path to the terraform code
  • run_command(string) - override the command to run Terraform
  • install_command(string) - override the command to run Terraform
  • staging_dir(string) - override the remote path to stage the code.
  • variables(map(String, String)) - set terraform variables into a terraform.auto.tfvars file

License

The code is available as open source under the terms of the Mozilla Public License 2.0

packer-plugin-terraform's People

Contributors

dependabot[bot] avatar tristanmorgan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

packer-plugin-terraform's Issues

Windows provisioning

Currently this provider makes some assumptions that it is running on linux guests. It should also work on Windows too.
</note to self>

Update for HCL based templates

(Note to self?) I think there needs to be a small update to the provisioner interface to support being used with the new Packer 1.5 HCL templates.

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.