terraplate

command module
v0.0.0-...-d8ef078 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

Terraplate logo

DRY Terraform with Go Templates

Go Report Card License

Terraplate is a thin wrapper around Terraform to keep things DRY and improve the developer experience.

How it works

Terraplate traverses up and down from the working directory detecting Terraplate files (AKA "Terrafiles"), treating the Terrafiles without child Terrafiles as Root Modules (i.e. if a Terrafile does not have any children, it's considered a Root Module where Terraform should be run).

Terraplate builds Terraform files based on your provided templates (using Go Templates). Define your Terraform snippets once, and reuse them with Go Templates to substitute the values based on the different root modules.

Terraplate example file structure

The built files are completely normal Terraform files that should be version controlled and can be applied either via the terraform CLI or using the terraplate CLI. This way you can focus on writing your Terraform code that creates resources, and let Terraplate handle the boilerplate (like backend, providers, configuration, etc) based on your provided templates.

The goal of Terraplate is to not do any magic: just plain (but DRY) Terraform, which means you can bring your own tools for static analysis, security, policies, testing and deployment.

The terraplate CLI allows you to run Terraform across all your Root Modules and provide a summary of plans.

terraplate-asciicast

Terraplate is a thin wrapper around Terraform aimed at reducing the amount of duplicate code used when working with multiple different Terraform root modules.

Documentation

Please check the Documentation

Project Status

Terraplate is stable and being used in production. There should be no breaking changes unless there is a new major version.

Terraplate does not have a cache, cleanup functionality or overwrite protection. It's quite dumb, by design, so please be careful that you do not overwrite existing files.

Examples

See the examples folder.

License

This code is released under the Apache-2.0 License.

Documentation

Overview

Copyright © 2021 Verifa <support@verifa.io>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
tui

Jump to

Keyboard shortcuts

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