packer-plugin-terraform

command module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MPL-2.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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