Skip to content

dogfish182/tf-restore-helper

Repository files navigation

Tf Restore Helper

PyPI Python Version License

Read the documentation at https://tf-restore-helper.readthedocs.io/ Tests Codecov

pre-commit Black

Features

  • Constructs Terraform import commands to assist an operator aligning a terraform state after volume restores have taken place by an external tool, which results in terraform misalignment.
  • Tool is currently only compatible with AWS volumes (PRs welcome) and is used at own risk. Operators that do not understand the terraform state file or what the produced commands will do, should not use this tool as a helper and proper state backup and recovery procedures should be well understood before making use of this.

Installation

You can install Tf Restore Helper via pip from PyPI:

$ pip install tf-restore-helper

Usage

Please see the Command-line Reference for details.

Examples of usage:

> tf-restore-helper --planfile tests/assets/plan.json
 2021-05-03 13:28:43 sbpltc1nplvdl botocore.credentials[79705] INFO Found credentials in environment variables.
 2021-05-03 13:28:46 sbpltc1nplvdl postrestoretfcli[79705]   WARNING THIS INFORMATION SHOULD BE USED ONLY IF YOU KNOW WHAT YOU ARE DOING!
 -----------Terraform volume alignment commands-----------
 terraform state rm "aws_ebs_volume.test-instance-volume-1"
 terraform state rm "aws_volume_attachment.test-instance-volume-1"

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, Tf Restore Helper is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.

About

A python cli to help align terraform state after an out of band restore.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages