tfbundle

command module
v0.0.0-...-0c0d4ac Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2020 License: MIT Imports: 5 Imported by: 0

README

CircleCI Go Report Card License Godoc CodeCov Releases

TFBundle

📦 Bundle a single artifact as a Terraform module

Installing

From source

You can install a development version of this tool by running:

$ go get -u github.com/joshdk/tfbundle
Precompiled binary

Alternatively, you can download a precompiled release binary by running:

$ wget -q https://github.com/joshdk/tfbundle/releases/download/0.1.0/tfbundle_linux_amd64
$ sudo install tfbundle_linux_amd64 /usr/bin/tfbundle

Usage

As a command line tool

The tfbundle tool can be used to consume a given file (lambda.zip in this example), and generate a fully contained Terraform module (module.tgz).

$ ls
lambda.zip

$ tfbundle -artifact lambda.zip -module module.tgz

$ ls
lambda.zip module.tgz

$ tar -tf module.tgz
main.tf
artifact
artifact/lambda.zip
As the resulting Terraform module
Configuration

The resulting module takes no inputs, just a source.

module "artifact" {
  source = "module.tgz"
}
Outputs

The etag output contains an entity tag for the bundled file. Used as a pass-through when configuring aws.s3_bucket_object.etag.

output "etag" {
  value = "${module.artifact.etag}"
}

The filename output contains the absolute path to the bundled file.

output "filename" {
  value = "${module.artifact.filename}"
}

The size output contains the size in bytes of the bundled file.

output "size" {
  value = "${module.artifact.size}"
}

The source_code_hash output contains a content hash for the bundled file. Used as a pass-through when configuring aws.lambda_function.source_code_hash.

output "source_code_hash" {
  value = "${module.artifact.source_code_hash}"
}

License

This library is distributed under the MIT License, see LICENSE.txt for more information.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package bundle implements functions for serializing data into single-file Terraform modules.
Package bundle implements functions for serializing data into single-file Terraform modules.
Package shim implements functions for rendering the Terraform shim.
Package shim implements functions for rendering the Terraform shim.

Jump to

Keyboard shortcuts

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