Skip to main content

tfmv

Simple tool for moving / renaming resources in one or several terraform configurations.


When moving or renaming resources or modules in terraform configurations, objects in the corresponding state are typically destroyed and recreated by terraform apply.

This may be impractical, or impossible for certain resources, and the objects in the state must be moved manually, one by one, to prevent this.

This tool helps to automate this state operation.

The operations are:

  • terraform state pull to get local copies of the remote state(s)
  • terraform state list to identify objects matching the given prefix
  • terraform state mv is called to move or rename the resource based on the prefix
  • terraform state push to push the modified state back to the remote
  • clean local files

Usage:

  • rename:

    tfmv google_compute_network.old_name google_compute_network.new_name --src /home/vincent/my-project 
    
  • move from root to module:

    tfmv google_compute_network.vpc module.my_module.google_compute_network.vpc --src /home/vincent/my-project  
    
  • renaming module:

    tfmv module.my_module module.my_module_renamed --src /home/vincent/my-project  
    

Release files for tfmv 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tfmv 1.2
File Size Uploaded
tfmv-1.2.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tfmv 1.2
File Interpreter ABI Platform
tfmv-1.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / tfmv-1.2.tar.gz

Download URL tfmv-1.2.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5b96374d4fdbe4657b8677032befa099c43b5977e8bbbf061fbeeadb7c9fb889
BLAKE2b-256 checksum
How to use checksums
ad9b6c02b5c272ca1ef786731de5adeebf43184021969cbed49c46e027fb8ab1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Release files / tfmv-1.2-py3-none-any.whl

Download URL tfmv-1.2-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ed4e82d26ea406d974ff42a224272e6c6b8890dd4d1cd9cc366786e73ffe5f9
BLAKE2b-256 checksum
How to use checksums
d64242cc042d10fbddde8ecd2b674cd2802f3889482eaf36d03169776c256bdf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page