Skip to main content

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

Project description

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  
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tfmv-1.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tfmv-1.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file tfmv-1.2.tar.gz.

File metadata

  • Download URL: tfmv-1.2.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for tfmv-1.2.tar.gz
Algorithm Hash digest
SHA256 5b96374d4fdbe4657b8677032befa099c43b5977e8bbbf061fbeeadb7c9fb889
MD5 04e0011883fb83c01de8bf1ad6952fe0
BLAKE2b-256 ad9b6c02b5c272ca1ef786731de5adeebf43184021969cbed49c46e027fb8ab1

See more details on using hashes here.

File details

Details for the file tfmv-1.2-py3-none-any.whl.

File metadata

  • Download URL: tfmv-1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for tfmv-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2ed4e82d26ea406d974ff42a224272e6c6b8890dd4d1cd9cc366786e73ffe5f9
MD5 0e131cc69b62218d6dc4284c1d28d1ed
BLAKE2b-256 d64242cc042d10fbddde8ecd2b674cd2802f3889482eaf36d03169776c256bdf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page