Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 1.18 KB

README.md

File metadata and controls

26 lines (19 loc) · 1.18 KB

Test

terraform-plan-editor

This is a hacky little tool that I wrote to sanitize secrets out of terraform plans. It is very rudimentary and using it is a bit like performing surgery with a spoon.

Caution

Under no circumstances should you use this utility to edit plans for real infrastructure

The tool unpacks an existing Terrform plan created with terraform plan -out=tf.plan and allow you to make edits to every file in the plan. The plan contents themselves, especially the binary tfplan, is fairly complicated to edit. As such, you'll likely need to specify both a text editor and binary editor if your plan includes resources that utilize the DynamicPseudoType. Where possible we try to render binary data as JSON when editing. Some msgpack binary data connot be easily round tripped without type information. In those cases it will have you edit the binary chunk with a binary editor.

Usage

go run ./ --editor=nvim --bin-editor='nvim -b' ../path/to/source/tf.plan ./path/to/edited.plan

Note

I have only tested this with nvim as both the text editor and binary editor.