magodo / tfmerge Goto Github PK
View Code? Open in Web Editor NEWA tool to merge Terraform state files
License: Mozilla Public License 2.0
A tool to merge Terraform state files
License: Mozilla Public License 2.0
tfmerge: cb78f836b8f81e260e37255fba3dd3e63b148e82
environment: Darwin bne-nb-ariel 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:19:22 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8112 arm64 arm Darwin
Attempting to merge state files.
State files are merged and output file is populated with entire state.
$ tfmerge -o infra2.tfstate infra1.tfstate 02-base.json
Error: Failed to load plugin schemas
Error while loading schemas for plugin components: Failed to obtain provider
schema: Could not load the schema for provider
registry.terraform.io/hashicorp/random: failed to instantiate provider
"registry.terraform.io/hashicorp/random" to obtain schema: unavailable
provider "registry.terraform.io/hashicorp/random"..
Hi, thanks for creating this tool! There's one edge case we're running when using this tool as part of a larger terraform import script - should the two statefiles share any resources in common, you'll get the following error:
resource {tf_resource} is defined in both state files terraform.tfstate and new.tfstate
Even if for example terraform.state
contains resources A, B
and new.tfstate
contains resources B, C
, ideally we'd want the import to still work such that terraform.state
contains resources A, B, C
after execution (skipping these resource defined errors)
Hi!
I have a directory with plenty of .tfstate files. I want to merge them into one. 1.tfstate to 200.tfstate
But i get 200 errors saying:
I ran "tfmerge -o 1.tfstate *"
showing state file /tfstate/done/100.tfstate: exit status 1
Failed to marshal state to json: no schema found for data.aws_sns_topic.sns_topic (in provider registry.terraform.io/-/aws)git/scripts/done/100.tfstate: exit status 1
Failed to marshal state to json: no schema found for data.aws_sns_topic.sns_topic (in provider registry.terraform.io/-/aws)
Also when i tried this:
"tfmerge -o 7.tfstate 8.tfstate 9.tfstate" i got:
1 error occurred:
* showing state file /tfstate/done/9.tfstate: exit status 1
Failed to marshal state to json: schema version 2 for aws_security_group_rule.instances_egress_all in state does not match version 0 from the provider
Thanks for helping out!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.