https://github.com/servian/packer-plugin-terraform
A Packer plugin for provisioning with Terraform (local)
https://github.com/servian/packer-plugin-terraform
packer packer-plugin packer-provisioner terraform
Last synced: about 1 year ago
JSON representation
A Packer plugin for provisioning with Terraform (local)
- Host: GitHub
- URL: https://github.com/servian/packer-plugin-terraform
- Owner: servian
- License: mpl-2.0
- Created: 2019-11-20T04:59:35.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-03-09T14:14:39.000Z (over 3 years ago)
- Last Synced: 2025-04-01T17:08:51.807Z (about 1 year ago)
- Topics: packer, packer-plugin, packer-provisioner, terraform
- Language: Go
- Homepage: https://medium.com/weareservian/how-not-to-use-terraform-31c9e7fe2607
- Size: 115 KB
- Stars: 7
- Watchers: 22
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Packer Plugin Terraform
* [](https://travis-ci.com/servian/packer-plugin-terraform)
* [](https://opensource.org/licenses/MPL-2.0)
* [](https://goreportcard.com/report/github.com/servian/packer-plugin-terraform)
* [](https://github.com/Servian/packer-plugin-terraform/releases)
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](https://opensource.org/licenses/MPL-2.0)